Linux Today: Linux News On Internet Time.

5 Simple Bash Tips, Part III

Aug 13, 2009, 12:02 (0 Talkback[s])

[ Thanks to Chris7mas for this link. ]

"cd - is the same as cd $OLDPWD, where the $OLDPWD variable holds the previous working directory. You can also alias this to something like:
alias back='cd -' # or alias back='cd $OLDPWD'

"If you've just opened a new Bash session or sourced .bashrc, the $OLDPWD variable will be unset. Also, follow this discussion on reddit which is a great resource on this matter.

2. Make copies of files easier
This one is especially useful for creating backup files, but not only. To fasten up rename commands like mv file1 file1bak you can use something like:"

Complete Story

Related Stories: