Right-click "Save link as..." to download this worksheet.
This worksheet corresponds to this chapter of the Command Line Crash Course.
Before we jump into command line stuff, we have to talk about stacks.
A stack is a computer science concept. It is a data structure that you can imagine as a stack of paper on a table. You add new things to the top of the stack, one by one, and you remove things from the top of the stack, one by one.
When you add things to the stack, it's called "pushing," and when you remove things, it's called "popping."
Because we only manipulate the stack from the top, it's called a last-in-first-out (LIFO) data structure.
baz <- top
bar
foo
----- <- bottom
- push bat
- pop
- push zim
- pop
- pop
- push grr
- push dib
- push gaz
- pop
Additional notes:
Additional notes:
Additional notes:
Let's switch gears. Above, we were talking about stacks and stack operations (push and pop) in general. As you migh imagine, the Bash commands pushd
and popd
use a stack in order to work.
If the command pwd
means "print working directory," what does pushd
mean? What does popd
mean?
What is it (give an example) and what does it do?
Additional notes:
If so, what happens if you don't give an argument?
Additional notes:
Additional notes:
What is it (give an example) and what does it do?
Additional notes:
Additional notes:
Additional notes:
Additional notes: