Skip to content

Instantly share code, notes, and snippets.

@sdondley
Last active May 22, 2023 17:19
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sdondley/c5d8818f0e9879b8e7953b15e16bfe3c to your computer and use it in GitHub Desktop.
Save sdondley/c5d8818f0e9879b8e7953b15e16bfe3c to your computer and use it in GitHub Desktop.
bash tips and tricks
You'll often see this recommendation for navigating up a directory tree.
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
etc.
But there is better, shorter way:
alias .1='cd ../'
alias .2='cd ../../'
alias .3='cd ../../../'
alias .4='cd ../../../../'
etc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment