Operations 7 min read

21 Essential Linux Commands Every Sysadmin Should Master

Master the most useful Linux commands for everyday system administration, covering file navigation, permission handling, process control, text manipulation, compression, and system shutdown, with clear examples and syntax to boost efficiency and confidence in handling common operational tasks.

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

In Linux system administration, mastering a concise set of commands greatly improves efficiency and confidence when handling routine tasks.

File and Directory Operations

cd : Change directory. Example:

cd /home    # enter /home directory
cd ..       # go up one level
cd -        # return to previous directory

ls : List directory contents.

ls          # list files
ls -l       # detailed view
ls -a       # include hidden files

cp : Copy files or directories.

cp file1 file2               # copy file
cp -r /src /dest            # recursive copy of a directory
cp -p file1 /backup         # preserve timestamps and permissions

mv : Move or rename files.

mv file1 file2               # rename
mv /src /dest               # move directory

rm : Remove files or directories (use with caution).

rm file1                    # delete file
rm -r /dir                  # recursively delete directory

File Content Viewing

cat and tac : Display file contents forward and backward.

cat file1                   # view file
tac file1                   # view file in reverse order
cat -n file1               # show line numbers

head and tail : Show beginning or end of a file.

head -n 5 file1            # first 5 lines
tail -n 5 file1            # last 5 lines
tail -f logfile            # follow a log file in real time

Permission Management

chmod : Change file permissions.

chmod 755 file1            # rwxr-xr-x
chmod u+x file1            # add execute permission for owner

chown : Change file owner.

chown user1 file1          # set owner to user1
chown -R user1:usergroup /dir   # recursive ownership change

chgrp : Change file group.

chgrp group1 file1         # set group to group1

Process Management

ps : List running processes.

ps aux                     # detailed list of all processes
ps -ef                     # full-format listing

top : Real‑time system resource monitor.

top                        # dynamic view of CPU, memory, processes

kill and killall : Terminate processes.

kill -9 <pid>               # force kill a specific PID
killall -9 program_name   # kill all instances of a program

File Compression and Extraction

tar : Archive files.

tar -cvf archive.tar /dir   # create tar archive
tar -xvf archive.tar        # extract archive

gzip and gunzip : Compress and decompress.

gzip file1                 # compress
gunzip file1.gz           # decompress

zip and unzip : ZIP archive handling.

zip archive.zip file1 file2   # create zip
unzip archive.zip            # extract zip

Text Processing

grep : Search file contents.

grep "error" logfile       # case‑sensitive search
grep -i "error" logfile    # case‑insensitive search

sort and uniq : Sort and deduplicate.

sort file1                 # alphabetical sort
uniq file1                 # remove duplicate lines

sed : Stream editor for text substitution.

sed 's/old/new/g' file1    # replace all occurrences of "old" with "new"

System Related

shutdown and reboot : Power off or restart the system.

shutdown -h now           # immediate shutdown
shutdown -r +5            # reboot after 5 minutes
These 21 commands cover file manipulation, permission management, process control, and text handling, providing a solid toolbox for Linux operations and enabling rapid response to common administrative challenges.
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-line
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.