18
|
Now we will return to your home directory and use commands to move
around using relative and
absolute paths.
IMPORTANT:
In the following list of commands, replace
with
the path to your home directory that you wrote down on Page 16.
As you can see, you can chain different folders together to move between many levels in a single
command.
The command you ran was ‘cd /’ The ‘../’ part of this is the path that you are moving to. This is what
is known as a relative path, as you moved up one level (to /home) relative to your starting position
(from /home/msai135).
cd ~
pwd
cd
pwd
cd ~
pwd
cd ~/Desktop
pwd
cd ../
pwd
Changes Directory to your home
directory (donated by ~)
Print the current working directory -
You should be in /home/msai135 (where
msai135 is your own username)
Changes directory using an absolute
path. the ‘/’ denotes the root of the
filing system.
Print the current Working Directory
to confirm your current location
Return to your home directory
Print the current Working Directory
to confirm your current location
Change Directory to your Desktop
folder, which is absolute to the
root(/) of the system.
Print the current working directory
to confirm your current location
The ../ tells the system to navigate
up exactly one level, relative to
your current working directory.
Print the current working directory
to confirm your current location