Operations 7 min read

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.

Liangxu Linux
Liangxu Linux
Liangxu Linux
20 Essential Linux Commands Every Sysadmin Should Master

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 directory

Listing directory contents

ls -l      # detailed file information
ls -a      # include hidden files
ls -lh     # human‑readable file sizes
ls -R      # recursive listing of subdirectories

Show current directory

pwd   # display the full path of the working directory

Copy 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 newer

Move 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 overwriting

Delete 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 user

Search 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 DEBUG

Process inspection

ps aux          # list all processes
ps axjf         # display process tree

System 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 12345

Kill by name

killall nginx   # terminate all processes named nginx

Print text

echo "Hello, World!"   # output a string
echo $HOME              # display the home directory

View file contents

cat file.txt                # display a file
cat file1.txt file2.txt > all.txt   # concatenate files

Paginated view

less /var/log/syslog   # page through a log file

Check directory size

du -sh /var/log   # summary size of a directory
du -h --max-depth=1   # size of each subdirectory in the current folder

Disk usage

df -h   # human‑readable disk space usage

Archive 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 archive

Network testing

ping google.com          # continuous ping
ping -c 4 google.com     # send 4 packets then stop

Secure copy

scp file.txt user@server:/path/   # upload a file
scp user@server:/path/file.txt ./  # download a file

Conclusion

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.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

OperationsLinuxShellcommand-lineSysadmin
Liangxu Linux
Written by

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.)

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.