Any shortcut for "cd .."?
Not by default (There might be some exceptions to this), there isn't. But if you use the alias
command you can create a shortcut like this:
alias ..="cd .."
This will allow you to use the command ..
to do cd ..
.
Activate the autocd
option. It will let you type ..
for cd ..
and will actually let you use any directory as a command name and will cd
to it:
shopt -s autocd
For the curious, the same exists for zsh:
setopt auto_cd
I find this useful:
up() { local p= i=${1:-1}; while (( i-- )); do p+=../; done; cd "$p$2" && pwd; }
For example, up 4
= cd ../../../..
As a bonus, `up 4`/path/to/file
works in a similar way to ../../../../path/to/file
.