DEV Community

Discussion on: My favourite aliases

Collapse
wulfmann profile image
Joseph Snell • Edited on

These have saved me a lot of time:

alias .. = '../'
alias ... = '../../'
alias .... = '../../../'
alias ..... = '../../../../'

# cd after mkdir
function mcd {
    mkdir -p "$@" && builtin cd "$@"
}

# ls after cd
function cd {
    builtin cd "$@" && ls -G
}
Collapse
sethbergman profile image
Seth Bergman

I've done something similar as well.

alias ..="cd .."
alias ...="cd .. && cd .."

It's a time saver for sure!

Collapse
gene profile image
Gene

Wise man!

Collapse
bugb profile image
bugb • Edited on

the first time tried I use same as you, but when typing '..?', it will make me need to count how many dot and then it can hurt my eye. So better I switch to something like this:

alias cd2 = '../../'
alias cd3 = '../../../'
alias cd4 = '../../../../'

less typo, easy to remember so it better