Linux Navigation in Simple Terms
When using Linux, moving around in the system is similar to how you use a mouse in Windows. You navigate through files and folders using commands. These commands help you find, list, and manage files and directories.
1. Check Your Current Location
To see where you are in the system, use the pwd command:
pwdExample output:
/home/usernameThis tells you that you are inside the home directory.
2. List Files and Folders
To see what’s inside a directory, use the ls command:
lsExample output:
Desktop Documents Downloads Music Pictures VideosThis shows all the files and folders inside your current location.
To see more details (permissions, owner, size, and date modified), use:
ls -lExample output:
drwxr-xr-x 2 username groupname 4096 Nov 13 17:37 Desktop
drwxr-xr-x → File type and permissions
2 → Number of hard links
username → Owner
groupname → Group owner
4096 → Size in bytes
Nov 13 17:37 → Date modified
Desktop → File/Folder name
To see hidden files (files that start with a dot .), use:
ls -la3. Change Directories
To move into a folder, use cd:
cd DocumentsTo go back to the previous directory:
cd ..To go directly to another directory, use the full path:
cd /var/logTo return to the last directory you were in:
cd -4. Auto-Complete
Instead of typing long folder names, you can use the Tab key to complete them. For example, if you type:
cd /dev/sPress Tab and Linux will suggest options like:
shm/ snd/If you type more letters, it will complete the folder name.
5. Clear the Screen
To clean up your terminal, use:
clearOr press Ctrl + L.
6. Check Directory Contents Without Entering It
You don’t need to enter a folder to check what’s inside. Instead, run:
ls -l /var/log