Think of your computer hard drive as a real-world filing cabinet. Inside that cabinet are folders, and inside those folders are documents. When you use a graphical interface, you click on folders with your mouse. In Linux, you can explore that same filing cabinet using three magical, friendly commands!
Meet the Three Navigators
Before typing anything, let us introduce the three tools in plain words:
pwd(Print Working Directory): Asks the computer, "Where in the world am I standing right now?"ls(List): Asks the computer, "What files and folders are in this room with me?"cd(Change Directory): Tells the computer, "Walk into this room or step outside."
Hands-on Example: Exploring Your Files Step by Step
Here is how you navigate around safely. None of these commands can break anything, so feel completely free to explore!
# Step 1: Check your current location
pwd
# Step 2: Look at everything sitting in your current folder
ls
# Step 3: Step inside a folder named 'Documents'
cd Documents
# Step 4: Step back out to the previous folder (the two dots mean 'go back one level')
cd ..
Understanding Paths in Plain English
A path is just directions to a place. If you give directions from the very entrance of the building starting with a slash (/home/bagus/Documents), that is an absolute path. If you give directions from where you are currently standing (cd Documents), that is a relative path.
3 Things to Remember
pwdtells your location: Use it whenever you feel lost in the terminal.lsshows what is around you: Like turning on the lights in a room.cd ..steps backward: The double dot always takes you up one folder level.