To make use of any Linux system, you need to be comfortable with
Linux files and directories (a.k.a. folders). In
a “windows and icons” system, the files and directories are obvious on
screen. With a command-line system like the Linux shell, the same files
and directories are still present but are not constantly visible, so at
times you must remember which directory you are “in” and how it relates
to other directories. You’ll use shell commands like
to “move” between directories and keep track of where you are.
Let’s cover some terminology. As we’ve said, Linux files are collected into directories. The directories form a hierarchy, or tree, as in Figure 1-3: one directory may contain other directories, called subdirectories, which may themselves contain other files and subdirectories, and so on, into infinity. The topmost directory is called the root directory and is denoted by a slash (/).
Figure 1-3. A Linux filesystem (partial). The root folder is at the top. The “dan” folder’s full path is /home/dan.
We refer to files and directories using a “names and slashes” syntax called a path. For instance, this path:
refers to the root directory /, which contains a directory called one, which contains a directory two, which contains a directory three, which contains a final file or directory, four. If a path begins with the root directory, it’s ...