
The Linux terminal is one of the most powerful tools available to Linux users.
Instead of relying only on graphical applications, you can use commands to navigate the file system, manage files, install software, monitor the system, troubleshoot networks, and administer servers.
If you’re learning Linux, you don’t need to memorize hundreds of commands. Start with the most useful ones and practice them regularly.
In this guide, we’ll look at 30 essential Linux commands that every beginner should know.
1. pwd — Show Your Current Directory
pwd stands for Print Working Directory.
It shows your current location in the Linux file system.
pwdExample:
/home/yourname2. ls — List Files
ls displays files and directories.
lsFor more detailed information:
ls -lTo show hidden files:
ls -la3. cd — Change Directory
Use cd to move between directories.
cd DocumentsGo back to the previous directory:
cd ..Go directly to your home directory:
cd ~4. mkdir — Create a Directory
Create a new folder with:
mkdir projectsYou can create multiple directories:
mkdir linux networking cybersecurity5. touch — Create a File
Create an empty file:
touch example.txtYou can create several files at once:
touch file1.txt file2.txt file3.txt6. cp — Copy Files
Copy a file:
cp example.txt backup.txtCopy a directory and its contents:
cp -r projects projects-backup7. mv — Move or Rename Files
Rename a file:
mv old.txt new.txtMove a file:
mv example.txt Documents/8. rm — Delete Files
Remove a file:
rm example.txtRemove a directory and its contents:
rm -r projects⚠️ Be careful with rm. Deleted files may not be recoverable through a normal recycle bin.
9. cat — Display File Contents
Display the contents of a text file:
cat example.txtIt’s useful for quickly reading configuration files and text documents.
10. less — Read Large Files
For large files, less is more convenient than cat.
less /var/log/syslogYou can scroll through the file and search its contents.
Press:
qto exit.
File and Text Management
11. grep — Search for Text
grep searches for a specific word or pattern.
Example:
grep "error" logfile.txtThis searches for lines containing:
errorYou can also search command output:
ip addr | grep inet12. find — Find Files
Search for a file:
find /home -name "example.txt"Search for files ending in .log:
find /var/log -name "*.log"find is extremely useful when working with Linux servers.
13. head — Show the Beginning of a File
Display the first lines:
head example.txtSpecify the number of lines:
head -n 20 example.txt14. tail — Show the End of a File
Display the last lines:
tail example.txtTo monitor a log file in real time:
tail -f /var/log/syslogThis is especially useful when troubleshooting services.
Permissions and Administration
15. chmod — Change Permissions
Change file permissions:
chmod +x script.shA common permission configuration is:
chmod 755 script.shPermissions determine who can read, write, or execute a file.
16. chown — Change Ownership
Change the owner of a file:
sudo chown user example.txtChange owner and group:
sudo chown user:developers example.txt17. sudo — Run a Command as Administrator
sudo allows authorized users to execute commands with elevated privileges.
Example:
sudo apt updateBe careful when using sudo because administrative commands can make significant changes to the system.
18. whoami — Show Current User
Find out which account you’re using:
whoamiExample output:
yournameSoftware Management
19. apt — Manage Packages
Ubuntu and Debian-based systems commonly use APT.
Update package information:
sudo apt updateInstall a package:
sudo apt install curlRemove a package:
sudo apt remove curlUpgrade packages:
sudo apt upgradeSystem Information
20. df — Check Disk Space
Display available disk space:
df -hThe -h option displays sizes in a human-readable format.
21. du — Check Directory Size
Check how much space a directory uses:
du -sh DocumentsThis is useful when investigating storage problems.
22. free — Check Memory
Display RAM and swap usage:
free -h23. uname — Display System Information
Show kernel information:
uname -aThis can help identify the running Linux kernel and system architecture.
Processes and Services
24. ps — View Processes
Display running processes:
psA more detailed view:
ps aux25. top — Monitor Processes
Run:
topThis displays processes and resource usage in real time.
You can monitor:
- CPU
- Memory
- Processes
- System load
Press:
qto exit.
26. systemctl — Manage Services
Check a service:
sudo systemctl status sshStart a service:
sudo systemctl start sshRestart a service:
sudo systemctl restart sshStop a service:
sudo systemctl stop sshsystemctl is an important command for Linux system administration.
Networking Commands
27. ip — Network Information
Display network interfaces:
ip addrDisplay routing information:
ip routeThe ip command is commonly used for Linux network troubleshooting.
28. ping — Test Connectivity
Test connectivity to another host:
ping 8.8.8.8You can also test a domain:
ping google.comPress:
Ctrl + Cto stop the command.
29. ss — Check Network Connections
Display listening ports:
ss -tulnThis can help identify services listening for network connections.
30. curl — Transfer Data and Test Websites
curl is commonly used to communicate with web servers.
For example:
curl https://example.comIt can also be useful for testing HTTP connectivity and APIs.
Linux Commands Cheat Sheet
Here’s a quick reference:
| Command | Purpose |
|---|---|
pwd | Show current directory |
ls | List files |
cd | Change directory |
mkdir | Create directory |
touch | Create file |
cp | Copy |
mv | Move/rename |
rm | Delete |
cat | Display file |
less | Read large files |
grep | Search text |
find | Find files |
head | Show beginning |
tail | Show end |
chmod | Change permissions |
chown | Change ownership |
sudo | Run with elevated privileges |
whoami | Show current user |
apt | Manage packages |
df | Disk space |
du | Directory size |
free | Memory usage |
uname | System information |
ps | Processes |
top | Process monitor |
systemctl | Manage services |
ip | Network information |
ping | Test connectivity |
ss | Network connections |
curl | HTTP/network requests |
Practice Linux Commands Safely
If you’re new to Linux, don’t experiment with important production systems.
Instead, create a Linux virtual machine using:
- VirtualBox
- VMware Workstation
- Hyper-V
Ubuntu is a good choice for beginners.
You can then practice commands without risking important files on your main computer.
A Simple Linux Practice Exercise
Create a practice directory:
mkdir linux-practiceEnter it:
cd linux-practiceCreate a file:
touch notes.txtAdd some text:
echo "Learning Linux" > notes.txtRead the file:
cat notes.txtCheck its permissions:
ls -l notes.txtFinally, check your current location:
pwdThis small exercise combines several commands from this article.
Conclusion
Learning Linux commands is one of the best ways to become comfortable with the Linux operating system.
You don’t need to memorize all 30 commands immediately. Start with navigation and file management, then gradually learn permissions, package management, system administration, and networking.
The more you practice, the more natural the Linux terminal will become.
For IT professionals, these commands are useful when working with Linux desktops, servers, cloud infrastructure, networking, and cybersecurity.
FAQ
What Linux commands should beginners learn first?
pwd, ls, cd, mkdir, touch, cp, mv, and rm.Is the Linux terminal difficult?
Can I practice Linux commands without installing Linux?
What is the most important Linux command?
ls, cd, sudo, apt, systemctl, and ip are particularly useful for beginners and administrators.


