From 2bef29186d49e381550238c8df3a61938f339b53 Mon Sep 17 00:00:00 2001 From: Michael Hienle <40914576+mhienle@users.noreply.github.com> Date: Wed, 7 Nov 2018 23:54:57 +0100 Subject: [PATCH] Add cd - (#843) --- bash.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bash.md b/bash.md index de229b586..a4c54dc82 100644 --- a/bash.md +++ b/bash.md @@ -637,6 +637,16 @@ read -n 1 ans # Just one character See [Special parameters](http://wiki.bash-hackers.org/syntax/shellvars#special_parameters_and_shell_variables). +### Go to previous directory + +```bash +pwd # /home/user/foo +cd bar/ +pwd # /home/user/foo/bar +cd - +pwd # /home/user/foo +``` + ## Also see {: .-one-column}