re: My favourite aliases VIEW POST

FULL DISCUSSION
 

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
}
 
 

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

 

I've done something similar as well.

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

It's a time saver for sure!

code of conduct - report abuse