Skip to Content
Efficient Linux at the Command Line
book

Efficient Linux at the Command Line

by Daniel J. Barrett
February 2022
Intermediate to advanced
248 pages
5h 46m
English
O'Reilly Media, Inc.
Book available
Content preview from Efficient Linux at the Command Line

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

The Linux Command Line, 2nd Edition

The Linux Command Line, 2nd Edition

William E. Shotts
Learning Modern Linux

Learning Modern Linux

Michael Hausenblas

Publisher Resources

ISBN: 9781098113391Errata PageSupplemental Content