6
Chapter 1
Finding Yourself with pwd
Unlike when you’re working in a graphical user interface (GUI) environ-
ment like Windows or macOS, the command line in Linux does not always
make it apparent which directory you’re presently in. To navigate to a new
directory, you usually need to know where you are currently. The
present
working directory (or
print working directory) command,
pwd
, returns your
location within the directory structure.
Enter
pwd
in your terminal to see where you are:
kali >
pwd
/root
In this case, Linux returned
/root
, telling me I’m in the root user’s
directory. And because you logged in as root when you started Linux, you
should be in the root user’s directory, too, which is one level below the top
of the filesystem structure (
/).
If you’re in another directory,
pwd
will return that directory name
instead.