Shorter Hacks 23: Bash previous folder In bash you can not only cd into the last directory with cd - , but also use tilde-dash with any other command. For example: ls ~- will show the files in the previous directory.