
16.2 Getting From Here to There: cd 221
[billy@localhost /]$
That single forward slash means you’re at the root. When you’re at the root, you can’t go any higher
on your system (the same is true in DOS/Windows).
To get back to your login directory from the root directory by using the absolute path, just type:
cd /home/billy
You’re home.
Using the absolute path is just one way to move around. Another method of getting from one point
to another is by using the relative path (as in Figure 16.3).
Let’sgobacktotheroot directory:
cd /
Now, let’smoveback to your login directory using relative pathnames:
cd home/billy
Notice that the / is missing? That’s because the root directory is the parent of the home directory,
which means that the home directory is one step down from the root directory. Since home is the
parent of the directory called billy, these two directories are separated with a /.
If you’re in your login directory, you can move up one directory, to home, just by typing:
cd ..
The relative path describes the directory you want to cd to in terms which are relative to your current
directory.
When you typed cd ..,youweresaying“go up one directory.” The next directory up, from your
login directory, was home.
Tip: When speaking of directories which hold other directories, you can refer to them
as parent directories.Inourcase,home is the parent directory of billy.
Using two dots (..) when you cd is the same as stating you want to go to the parent of your current
working directory. Try using a single dot. Type:
Komentarze do niniejszej Instrukcji