Moving AgainSo far you have already used the cd command to change your current working directory and the pwd command to find out what your current working directory is. After you work with the command line for a while, you'll find yourself changing directories constantly. In order to make this easier, Bash provides a "directory stack" that you can use to quickly move around directories where you are doing some work. (We'll show some examples in a moment that help explain the idea of a "stack.") You have the following commands at your disposal:
If you need to have more of a visual aid to understanding a "stack", the simplest way is to imagine the "stack" as a pile of papers on your desk, you "push" new pieces of paper onto the top of the "stack" and you "pop" the top most piece of paper off the "stack". Both methods work on the principle of LIFO (last in first out).
You can play around with these commands to understand how they work. For example the following table provides a list of commands, their effect on the current working directory and their effect on the stack.
|