Getting Started with the Basics
7
line interface, the structure is entirely text based, and navigating the file-
system means using some commands.
Changing Directories with cd
To change directories from the terminal, use the
change directory command,
cd
. For example, here’s how to change to the
/etc directory used to store con-
figuration files:
kali >
cd /etc
kali:/etc >
The
prompt changes to
root@kali:/etc
, indicating that we’re in the
/etc
directory. We can confirm this by entering
pwd
:
kali:/etc >
pwd
/etc
To move up one level in the file structure (toward the root of the file
structure, or
/), we use
cd
followed by double dots (
..
), as shown here:
kali:/etc >
cd ..
kali >
pwd
/
kali >
This moves us up one level from
/etc to the
/ root directory, but you can
move up as many levels as you need. Just use
the same number of double-
dot pairs as the number of levels you want to move:
• You would use
..
to move up one level.
• You would use
../..
to move up two levels.
• You would use
../../..
to move up three levels, and so on.
So, for example,
to move up two levels, enter
cd
followed by two sets of
double dots with a forward slash in between:
kali >
cd ../..
You can also move up to the root level in the file structure from any-
where by entering
cd /
, where
/
represents the root of the filesystem.