25+ Essential Linux Commands Every Beginner Should Know
Introduction
Linux powers most of the world’s servers, cloud platforms, and even Android devices. If you’re starting your journey with Linux, mastering basic commands is the first step. This guide covers 25+ essential Linux commands with practical examples, so you can confidently navigate the terminal.
1. File & Directory Management
pwd – Print Working Directory
Shows your current location in the filesystem.
pwd
# Output: /home/usernamels – List Files and Directories
Displays files and folders in the current directory.
ls -l # Detailed view
ls -a # Show hidden filescd – Change Directory
Move between directories.
cd /etc
cd .. # Go back one levelmkdir – Create Directory
mkdir projectsrmdir – Remove Empty Directory
rmdir old_folderrm – Remove Files/Directories
rm file.txt
rm -r folder_name # Delete a directory and its contentscp – Copy Files/Directories
cp file.txt backup.txt
cp -r dir1 dir2mv – Move or Rename Files
mv old.txt new.txt
mv file.txt /home/user/Documents/touch – Create Empty Files
touch notes.txtcat – View File Contents
cat file.txt2. File Viewing & Editing
nano – Simple Text Editor
nano file.txtless – View Large Files Page by Page
less logfile.txt
head – View First Lines of a File
head -n 10 file.txt
tail – View Last Lines of a File
tail -n 10 file.txt
tail -f /var/log/syslog # Monitor logs in real-time3. System Info & Navigation
whoami – Show Current User
whoamiuname – System Information
uname -a # Kernel, architecture, OS infodf – Disk Usage
df -h # Human-readable formatdu – Directory Size
du -sh /home/user/top – Monitor Processes
top(Tip: Install htop for a better interface.)
4. User & Permission Management
sudo – Run Commands as Root
sudo apt updatechmod – Change File Permissions
chmod 755 script.shchown – Change File Ownership
sudo chown user:user file.txt5. Networking & Package Management
ping – Test Connectivity
ping google.comcurl – Fetch Data from URL
curl https://example.comwget – Download Files
wget https://example.com/file.zipapt – Debian/Ubuntu Package Manager
sudo apt update && sudo apt upgrade
sudo apt install nginxyum / dnf – CentOS/RHEL Package Manager
sudo dnf install httpd6. Searching & Finding
grep – Search Text in Files
grep "error" logfile.txtfind – Locate Files
find /home -name "*.txt"which – Find Command Location
which python37. Bonus Tips
Use Tab completion to save typing.
Use history to see previous commands:
historyUse pipes (
|) and redirection (>,>>):ls -l | grep "config" > results.txt
Conclusion
These 25+ Linux commands form the foundation of working with the terminal. As you practice, you’ll discover endless ways to combine them for powerful workflows. Bookmark this guide as a reference and start exploring Linux with confidence.

