Great question! While the tilde (~) takes you "home," the cd .. command moves you one level up in the directory hierarchy.
In the world of Linux:
- The single dot (
.) represents your current directory. - The double dot (
..) represents your parent directory (the folder that contains the one you are currently in).
Let's look at an example:
If you are currently in:
/home/labex/project
And you run:
cd ..
Your new location will be:
/home/labex
Try it yourself!
- Go back to the project folder first:
cd ~/project - Then type
cd ..and press Enter. - Type
pwdto see where you landed.
You can think of cd .. as the "Back" or "Up" button in a file explorer! Do you want to try moving into another folder next?