Getting started with Linux can feel a bit overwhelming—especially when you're staring at that black terminal screen waiting for a command. But don’t worry! Linux commands are not as scary as they seem. In fact, once you get the hang of a few basic commands, you’ll feel a lot more confident navigating around your system like a pro.This guide walks you through 20 of the most essential Linux commands that every beginner should know. Let’s dive in!
1. pwd – Print Working Directory
This command tells you where you are in the file system.
pwd
Think of it like checking your current location on a map. Super helpful when you're navigating through folders.
2. ls – List Directory Contents
Want to see what files and folders are inside a directory? Use ls.
ls
You can also use options like ls -l (long listing format) or ls -a (show hidden files).
3. cd – Change Directory
This moves you from one folder to another.
cd Documents
Want to go back a step? Use cd ..
Need to go to your home directory? Just type cd.
4. mkdir – Make Directory
Want to create a new folder? Easy!
mkdir new_folder
You’ve now got a new directory named new_folder.
5. rmdir – Remove Directory
This removes empty directories.
rmdir old_folder
If the folder has stuff inside, you’ll need rm -r (explained next).
6. rm – Remove Files or Directories
Be careful with this one! It deletes files and folders.
rm file.txt
Want to delete a folder and its contents? Use:
rm -r folder_name
Add -f to force it without asking:
rm -rf folder_name
7. touch – Create a New File
This creates a blank file instantly.
touch file.txt
Great for creating files on the fly.
8. cp – Copy Files or Directories
To copy files from one place to another:
cp file.txt /home/user/Documents/
Use -r to copy directories.
9. mv – Move or Rename Files
Move or rename a file.
mv old.txt new.txt
Or move it somewhere else:
mv file.txt ~/Documents/
10. cat – View File Content
Quickly see what’s inside a file:
cat file.txt
Not great for very long files, though. Use less for that.
11. nano – Simple Text Editor
This opens a basic editor right in the terminal.
nano file.txt
Perfect for quick edits without needing a full IDE.
12. vim – Advanced Text Editor
A powerful, feature-rich editor for experienced users.
vim file.txt
Takes time to learn, but very popular among developers.
13. clear – Clear the Terminal Screen
Gets rid of the clutter.
clear
Just like wiping your whiteboard clean.
14. df – Show Disk Space
Want to know how much space is left on your drive?
df -h
The -h makes the output human-readable (like GB/MB).
15. du – Show Folder Size
See how much space a folder or file is using.
du -sh folder_name
16. chmod – Change File Permissions
Modify who can read, write, or execute a file.
chmod +x script.sh
This makes a script executable.
17. chown – Change File Owner
Change the owner of a file or directory.
sudo chown user:user file.txt
18. man – Manual Pages
Need help with a command? Use man.
man ls
This shows the manual (help guide) for that command.
19. kill – Stop a Process
Stop a program that’s stuck. First, find its process ID (PID):
ps aux | grep program_name
kill 1234
20. sudo – Run as Superuser
Do something with admin privileges.
sudo apt update
Be careful—sudo can make big system changes.
And there you go! These 20 commands form the foundation of working with Linux. Mastering them will make you feel right at home in the terminal—and open the door to even more powerful features. Don’t worry if you don’t remember them all right away. Bookmark this page, practice often, and soon enough, they’ll become second nature.