20 Essential Linux Commands Every Sysadmin Should Master
Mastering these 20 high‑frequency Linux commands—from navigating directories and managing files to monitoring processes—empowers system administrators to automate routine tasks, troubleshoot efficiently, and boost productivity across file management, process control, system monitoring, and remote operations.
Introduction
In Linux system administration, mastering concise command combinations can automate complex workflows and dramatically improve efficiency. The following list presents 20 frequently used commands covering file management, process control, system monitoring, text processing, and networking.
Directory navigation
cd /tmp # switch to /tmp directory
cd .. # go up one level
cd ~/Downloads # go to the user's Downloads folder
cd - # return to the previous directoryListing directory contents
ls -l # detailed file information
ls -a # include hidden files
ls -lh # human‑readable file sizes
ls -R # recursive listing of subdirectoriesShow current directory
pwd # display the full path of the working directoryCopy files
cp file.txt /backup/ # copy a file
cp -r /data/ /backup/ # recursively copy a directory
cp -i file1.txt file2.txt # prompt before overwriting
cp -u file1.txt file2.txt # copy only when source is newerMove or rename files
mv file.txt /archive/ # move a file
mv old_name.txt new_name.txt # rename a file
mv -i file.txt /archive/ # prompt before overwritingDelete files
rm file.txt # delete a file
rm -r /backup/ # recursively delete a directory
rm -i file.txt # prompt before deletion
rm -rf /data/ # force delete (use with caution)Find files
find / -name "*.log" # locate all .log files
find /var -size +100M # files larger than 100 MB
find . -perm 0755 # files with permission 0755
find / -user username # files owned by a specific userSearch file contents
grep "error" /var/log/syslog # find "error" in logs
grep -r "TODO" ./source/ # recursive search
grep -i "error" file.txt # case‑insensitive match
grep -v "DEBUG" file.txt # exclude lines containing DEBUGProcess inspection
ps aux # list all processes
ps axjf # display process treeSystem monitoring
top # real‑time resource usage
htop # enhanced interactive monitor (requires installation)Terminate processes
ps aux | grep nginx # locate nginx processes
kill -9 12345 # force‑kill process with PID 12345Kill by name
killall nginx # terminate all processes named nginxPrint text
echo "Hello, World!" # output a string
echo $HOME # display the home directoryView file contents
cat file.txt # display a file
cat file1.txt file2.txt > all.txt # concatenate filesPaginated view
less /var/log/syslog # page through a log fileCheck directory size
du -sh /var/log # summary size of a directory
du -h --max-depth=1 # size of each subdirectory in the current folderDisk usage
df -h # human‑readable disk space usageArchive files
tar -cvf backup.tar /data # create an archive
tar -xvf backup.tar # extract an archive
tar -czvf backup.tar.gz /data # create a compressed archiveNetwork testing
ping google.com # continuous ping
ping -c 4 google.com # send 4 packets then stopSecure copy
scp file.txt user@server:/path/ # upload a file
scp user@server:/path/file.txt ./ # download a fileConclusion
By integrating these commands into daily workflows, administrators can streamline file handling, monitor system health, troubleshoot issues, and perform remote operations more efficiently, turning a basic command set into a powerful toolkit for Linux system management.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
