16.2 Getting From Here to There: cd 223
cd ..
and you’ll find yourself at the root directory.
Using relative paths, get yourself back to your login directory by typing:
cd home/billy
Doesn’t look much different from absolute paths, does it? Notice, though, that there’snoforward
slashinfrontofhome. In essence, you were saying, “go one directory down, to home,thengoto
billy,inthehome directory.”
Tip: Whenever you want to quickly jump back to your login directory just type cd ˜
anywhere in the system.
That wasn’t much of a demonstration.
Try this: from your login directory, type:
cd ../../etc/X11
Now, you’re in the directory X11,whichiswhereyou’ll find configuration files and directories re-
lated to the X Window System.
Please Note: You can always type pwd to find out where you are in the directory tree. And you can
get back to your login directory with the cd ˜ command.
Take a look at your last cd command. What you were really telling your system was, “go up to the
parent directory, then up to that directory’s parent directory (which is the root directory), then go to
the etc directory and from there, to the X11 directory.”
Using an absolute path would also get you to the X11 quickly. Type:
cd /etc/X11
and you’re there.
Tip: Always make sure you know which working directory you’re in before you state
the relative path to the directory or file you want to get to. You don’t have to worry about
your position in the filesystem, though, when you state the absolute path to another
directory or file.
Comments to this Manuals