diff options
author | Divay Prakash <divayprakash@users.noreply.github.com> | 2018-10-03 09:51:32 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-03 09:51:32 +0530 |
commit | 662131f8a185cd8fcedb5b3ac32ae23ac6876855 (patch) | |
tree | 96f1f9a4e969c9e42744a3fe50536fd80e3d366b /bash.html.markdown | |
parent | 461022deb9ad887fa365c245f9816607cb5095ba (diff) | |
parent | 843626f3d30a06cc1c8b342c155a5dc8af24fbd1 (diff) |
Merge pull request #3248 from heyitswither/fix-cd2
[bash/en] add `cd` and `cd -` uses
Diffstat (limited to 'bash.html.markdown')
-rw-r--r-- | bash.html.markdown | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/bash.html.markdown b/bash.html.markdown index 1f59636e..b1ceb098 100644 --- a/bash.html.markdown +++ b/bash.html.markdown @@ -228,10 +228,13 @@ mv s0urc3.txt dst.txt # sorry, l33t hackers... # Since bash works in the context of a current directory, you might want to # run your command in some other directory. We have cd for changing location: cd ~ # change to home directory +cd # also goes to home directory cd .. # go up one directory # (^^say, from /home/username/Downloads to /home/username) cd /home/username/Documents # change to specified directory cd ~/Documents/.. # still in home directory..isn't it?? +cd - # change to last directory +# => /home/username/Documents # Use subshells to work across directories (echo "First, I'm here: $PWD") && (cd someDir; echo "Then, I'm here: $PWD") |