Opening a Linux terminal for the first time can look like entering a dark room with just a flashlight. But once you know three or four basic commands, moving around a Linux server becomes faster, simpler, and much more fun than clicking with a mouse.
Understanding Your Current Location
On a graphical desktop, you always see folder icons. In a terminal, you ask Linux where you are standing using pwd (Print Working Directory):
# Ask the terminal: where am I right now?
pwd
# Example Output: /home/alexSeeing What's Inside a Folder
To peek inside your current directory, use ls (List):
# List all files and folders in your current location
ls -lThe -l flag tells Linux to show extra details like file size and date modified in a neat vertical list.
Moving Between Folders
To walk into a different room, use cd (Change Directory). Think of it like double-clicking a folder:
# Move into your Documents folder
cd Documents
# Step back out one level to the previous folder
cd ..
# Jump straight back to your home folder anytime
cd ~Reading File Contents Safely
When you want to inspect a file without opening a heavy text editor, use cat or head:
# Read the first 5 lines of a log or text file
head -n 5 notes.txt3 Things to Remember
- pwd & ls: Use
pwdto check your location andls -lto see what is around you. - cd & cd ..: Use
cd folderto go inside, andcd ..to step back out. - cd ~: The tilde
~is your shortcut home from anywhere in the system.