Chapter 4. Cruising the Filesystem
In the movie The Adventures of Buckaroo Banzai Across the 8th Dimension, a classic cult comedy from 1984, the swashbuckling title character offers the following Zen-like words of wisdom: “Remember, no matter where you go…there you are.” Buckaroo could very well have been talking about the Linux filesystem:
$ cd /usr/share/lib/etc/bin No matter where you go... $ pwd /usr/share/lib/etc/bin ...there you are.
It’s also the case that wherever you are in the Linux filesystem—your current directory—you will eventually go somewhere else (to another directory). The faster and more efficiently you can perform this navigation, the more productive you can be.
The techniques in this chapter will help you navigate the filesystem more quickly with less typing. They look deceptively simple but have enormous bang for the buck, with small learning curves and big payoffs. These techniques fall into two broad categories:
-
Moving quickly to a specific directory
-
Returning rapidly to a directory you’ve visited before
For a quick refresher on Linux directories, see Appendix A.
If you use a shell other than bash, see Appendix B for
additional notes.
Visiting Specific Directories Efficiently
If you ask 10 Linux experts what is the most tedious aspect of the command line, seven of them will say, “Typing long directory paths.”1 After all, if your work files are in /home/smith/Work/Projects/Apps/Neutron-Star/src/include, your financial documents are in /home/smith/Finances/Bank/Checking/Statements ...