summaryrefslogtreecommitdiffhomepage
path: root/bash.html.markdown
diff options
context:
space:
mode:
authorTucker Boniface <tucker@boniface.tech>2018-10-02 19:23:45 -0700
committerTucker Boniface <tucker@boniface.tech>2018-10-02 19:41:43 -0700
commit843626f3d30a06cc1c8b342c155a5dc8af24fbd1 (patch)
tree3a28436ad7cd73d5585a165e794e2f0f1c87a0a4 /bash.html.markdown
parent67f785f10212ca827f25c83cfaa9dddc607a35c6 (diff)
[bash/en] add `cd` and `cd -` uses
Diffstat (limited to 'bash.html.markdown')
-rw-r--r--bash.html.markdown3
1 files changed, 3 insertions, 0 deletions
diff --git a/bash.html.markdown b/bash.html.markdown
index cb805da7..e609260f 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")