Skip to content

Moving around

In the terminal, there aren’t any icons like a file manager. To move between folders, you type short commands.

You can see your current folder with the pwd command:

/home/obay
pwd

pwd stands for print working directory. “Directory” is just another word for folder. /home/obay is your home folder, where your Documents, Downloads and other folders are.

Terminal window
ls
# Desktop Documents Downloads Music Pictures Videos

ls lists the contents of the current folder.

If you want to see what’s inside another folder, you can type the path of the folder after ls:

Terminal window
ls Pictures
# cat.jpg screenshots wallpaper.png

cd changes directory:

/home/obay/Pictures
cd Pictures
pwd

Some shortcuts:

Terminal window
cd .. # go up one folder
cd ~ # go home (cd alone works too)
cd - # go back to where you just were

A path is an address for a file or folder. There are 2 types.

An absolute path starts with / and works from anywhere. It’s the full address, starting from the very top of the system:

Terminal window
cd /home/obay/Pictures/screenshots

A relative path starts from the folder you’re in. If you’re already in /home/obay, these 2 do the same thing:

Terminal window
cd Pictures/screenshots
cd /home/obay/Pictures/screenshots

Symbols you’ll see in paths:

Symbol Means
/ The very top of the system (or a separator between folder names)
~ Your home folder
. The folder you’re in right now
.. The folder above this one

So ~/Downloads means “Downloads inside my home folder”, and ../Music means “go up one, then into Music”.

Quick check: you’re in /home/obay/Music. Where does cd ../Pictures take you?

/home/obay/Pictures. The .. goes up to /home/obay, then you go into Pictures from there.