From the course: Learning Zsh
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Directory stack and user dirs - Unix Tutorial
From the course: Learning Zsh
Directory stack and user dirs
- Earlier, I mentioned that CD with a dash or minus option, switches between the current and recent directories. That's useful for switching back and forth but for a longer list of directories that we might need to switch between, we can use the directory stack. It's a list of recent directories that we can move within and reorder as needed. To view the stack, we can use the dirs built in. I only have my home directory there right now. And we can use pushd and popd to manipulate the stack. Pushd works like CD, except that in addition to changing the working directory to whatever you set it, it also adds that directory to the directory stack. I'll step into a few directories here using pushd. (keys click) Now I'm in ETC. (keys click) And now I'm in VAR. (keys click) Here I am at the root. (keys click) Now, if I type dirs, I can see the stack, the list of directories that I've moved through. I can move between…
Contents
-
-
-
-
Autocd and cd shorthand4m 15s
-
(Locked)
Directory stack and user dirs4m 17s
-
(Locked)
Finding files and commands3m 59s
-
(Locked)
Autocompletion4m 52s
-
(Locked)
Redirection and multios6m 14s
-
(Locked)
Command history4m 24s
-
(Locked)
History shell variables2m 11s
-
(Locked)
Expansions8m 20s
-
(Locked)
Renaming files with zmv7m 29s
-
(Locked)
Scripting5m 29s
-
-
-