Most Important Linux Commands and Their Usage
Mastering Linux command-line tools is key to effective system administration. Below is a categorized list of essential Linux commands for beginners and professionals alike.
Managing Users and Permissions
-
- su – Switch user identity.
su [options] [username] - sudo – Execute a command with superuser privileges.
sudo command - chown – Change file/directory ownership.
chown [option] owner[:group] file - useradd / userdel – Add or delete a user.
useradd username/userdel username - chmod – Change file permissions.
chmod [mode] [file]
- su – Switch user identity.
Managing Files and Directories
-
- ls – List files and directories.
ls -lah - cd – Change directory.
cd /path/to/dir - pwd – Print current working directory.
pwd - mkdir / rmdir – Create or remove directories.
mkdir newdir/rmdir dir - rm – Remove files or directories.
rm -rf file_or_directory - cp – Copy files or directories.
cp source destination - mv – Move or rename files.
mv oldname newname - file – Determine file type.
file filename - touch – Create or update a file timestamp.
touch newfile.txt - tar – Create or extract archives.
tar -cvzf archive.tar.gz directory/ - zip / unzip – Compress or extract ZIP files.
zip file.zip file1 file2/unzip file.zip
- ls – List files and directories.
Text Processing and Searching
-
- cat – View or concatenate files.
cat file.txt - nano, vi, jed – Edit text files.
nano file.txt - sed – Stream editor for find and replace.
sed 's/old/new/g' file.txt - grep – Search for text patterns.
grep keyword file.txt - awk – Pattern scanning and processing.
awk '{print $1,$2}' file.txt - head / tail – View start or end of files.
head file.txt/tail file.txt - cut – Extract fields from text.
cut -d',' -f1 file.txt - sort / diff – Sort or compare files.
sort file.txt/diff file1 file2 - find / locate – Search for files.
find /home -name "*.txt"/locate file.txt
- cat – View or concatenate files.
Network Management and Troubleshooting
-
- wget – Download from the web.
wget https://example.com/file.zip - curl – Transfer data.
curl -O https://example.com/file.zip - ping – Test network connectivity.
ping example.com - rsync – Synchronize directories.
rsync -av source/ destination/ - scp – Secure copy between systems.
scp file user@host:/path - netstat – Display network statistics.
netstat -tuln - ifconfig / ip – View or configure network interfaces.
ifconfigorip addr - nslookup – Query DNS records.
nslookup domain.com - traceroute – Trace packet routes.
traceroute google.com
- wget – Download from the web.
System Management and Information
-
- ps – Display running processes.
ps aux - top / htop – Monitor system processes.
top/htop - df / du – Check disk space.
df -h/du -sh * - uname / hostname – System info.
uname -a/hostname -i - systemctl – Manage services.
systemctl status service-name - shutdown – Schedules shutdown or reboot.
shutdown -r +10 "Rebooting in 10 min" - kill – Terminate unresponsive processes.
kill PID - time – Measure command execution time.
time command - watch – Re-run commands at intervals.
watch -n 2 df -h
- ps – Display running processes.
Miscellaneous Commands
-
- man – View manuals.
man ls - history – Show command history.
history - alias / unalias – Create or remove command shortcuts.
alias ll='ls -l' - echo – Print text.
echo "Hello World" - cal – Display calendar.
cal 10 2025 - clear – Clear terminal screen.
clear
- man – View manuals.
Productivity Tips
-
- Press Tab to auto-complete commands.
- Use Ctrl+C to stop ongoing processes.
- Use Ctrl+Z to suspend running jobs.
- Use exit to close the terminal session.
With these Linux commands in hand, you can efficiently navigate, configure, and troubleshoot Linux systems with ease.