aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc_src
diff options
context:
space:
mode:
authorGravatar Fabian Homborg <FHomborg@gmail.com>2015-08-10 18:43:01 +0200
committerGravatar Fabian Homborg <FHomborg@gmail.com>2015-09-11 11:33:04 +0200
commit53456b5fc3932784edfc009a6f96aa3fcb499ec4 (patch)
tree0abc97afcafceb2671b9d27ec553f62d5f1a4579 /doc_src
parent73a5e2bc6b52c90e73a6bd0c9663eb7c9ac7073d (diff)
Document pushd "+N" and "-N"
Fixes #2173
Diffstat (limited to 'doc_src')
-rw-r--r--doc_src/pushd.txt19
1 files changed, 17 insertions, 2 deletions
diff --git a/doc_src/pushd.txt b/doc_src/pushd.txt
index 25d93936..8fad3bd7 100644
--- a/doc_src/pushd.txt
+++ b/doc_src/pushd.txt
@@ -9,6 +9,13 @@ pushd [DIRECTORY]
The `pushd` function adds `DIRECTORY` to the top of the directory stack and makes it the current working directory. <a href="#popd">`popd`</a> will pop it off and return to the original directory.
+Without arguments, it exchanges the top two directories in the stack.
+
+`pushd +NUMBER` rotates the stack counter-clockwise i.e. from bottom to top
+
+`pushd -NUMBER` rotates clockwise i.e. top to bottom.
+
+See also `dirs` and `dirs -c`.
\subsection pushd-example Example
@@ -21,7 +28,15 @@ pushd /usr/src/fish-shell
# Working directory is now /usr/src/fish-shell
# Directory stack contains /usr/src /usr/src/fish-shell
-popd
+pushd /tmp/
+# Working directory is now /tmp
+# Directory stack contains /tmp /usr/src /usr/src/fish-shell
+
+pushd +1
# Working directory is now /usr/src
-# Directory stack contains /usr/src
+# Directory stack contains /usr/src /usr/src/fish-shell /tmp
+
+popd
+# Working directory is now /usr/src/fish-shell
+# Directory stack contains /usr/src/fish-shell /tmp
\endfish