Your home directory is your initial location when you log in, but you’ll probably work at other locations as well. You should make a practice of moving to the directory that contains the files you want to work on. This chapter discusses the capabilities that the shell provides for traveling quickly and easily through the file system:
Basic commands for moving around the file system
The directory stack (what it is, how it helps you, and how to use it)
Using aliases and variables to make changing directories an easy task
As you become more adept at moving around, you may notice how easy it is to forget where you are. Chapter 14, Keeping Track of Where You Are, discusses how to avoid “getting lost” in the file system.
The primary command for changing your location in the file system is cd (change directory), which can move you into any directory for which you have permission. In order to use cd effectively, you should learn the basic idioms:
% cdMove to your home directory
% cd ..Move up to parent of current directory
% cd dirlMove to dir1 under current directory
% cd dirl/dir2/dir3Move to directory several levels below current directory
% cd /Move to root directory
% cd /dirlMove to dir1 under root directory
% cd /dirl/dir2/dir3Move to directory several levels below root directory
With Safari, you learn the way you learn best. Get unlimited access to videos, live online training,
learning paths, books, interactive tutorials, and more.