CHAPTER 4Moving Around the Filesystem
The Linux filesystem is the structure in which all of the information on your computer is stored. In fact, one of the defining properties of the Unix systems on which Linux is based is that nearly everything you need to identify on your system (data, commands, symbolic links, devices, and directories) is represented by items in the filesystems. Knowing where things are and understanding how to get around the filesystem from the shell are critical skills in Linux.
In Linux, files are organized within a hierarchy of directories. Each directory can contain files as well as other directories. You can refer to any file or directory using either a full path (e.g., /home/joe/myfile.txt) or a relative path (e.g., if /home/joe were your current directory, you could simply refer to the file as myfile.txt).
If you were to map out the files and directories in Linux, it would look like an upside-down tree. At the top is the root directory (not to be confused with the root user), which is represented by a single slash (/). Below that is a set of common directories in the Linux system, such as bin, dev, home, lib, and media. Each of those directories, as well as directories added to the root directory, can contain subdirectories.
Figure 4.1 illustrates ...
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.
Read now
Unlock full access