Operations 17 min read

Essential Linux Commands Every Sysadmin Should Master

This article provides a comprehensive reference of Linux commands, explaining their purpose and usage across categories such as file management, system monitoring, networking, user administration, and process control, helping readers efficiently manage and troubleshoot Linux systems.

Efficient Ops
Efficient Ops
Efficient Ops
Essential Linux Commands Every Sysadmin Should Master

Linux commands are used to manage the Linux operating system. In Linux, everything—including CPU, memory, disks, keyboard, mouse, and users—is represented as a file, and these commands form the core of system operation, similar to DOS commands. Linux commands are divided into built‑in shell commands and external Linux commands.

Online Query and Help Commands (2)

man : View command help and manuals; more complex alternatives like info exist.

help : Show help for built‑in shell commands such as cd.

File and Directory Operations (18)

ls : List directory contents and attributes.

cd : Change the current working directory.

cp : Copy files or directories.

find : Search for files or directories.

mkdir : Create a new directory.

mv : Move or rename files.

pwd : Print the absolute path of the current directory.

rename : Rename files.

rm : Remove one or more files or directories.

rmdir : Remove empty directories.

touch : Create an empty file or update timestamps.

tree : Display directory contents in a tree structure.

basename : Show the file name component of a path.

dirname : Show the directory component of a path.

chattr : Change extended file attributes.

lsattr : List extended file attributes.

file : Determine the file type.

md5sum : Compute and verify a file’s MD5 checksum.

File and Content Processing Commands (21)

cat : Concatenate files and output to the screen or another file.

tac : Reverse the order of cat output.

more : Paginate file output.

less : Paginate file output with backward navigation.

head : Show the beginning of a file.

tail : Show the end of a file.

cut : Split lines by a delimiter and output selected fields.

split : Divide a file into smaller pieces.

paste : Merge lines from multiple files.

sort : Sort text lines.

uniq : Remove duplicate lines.

wc : Count lines, words, or bytes.

iconv : Convert file encoding.

dos2unix : Convert DOS line endings to UNIX.

diff : Compare differences between files.

vimdiff : Visual diff tool for files.

rev : Reverse the characters in each line.

grep/egrep : Filter lines matching patterns.

join : Join two files on a common field.

tr : Translate or delete characters.

vi/vim : Command‑line text editors.

File Compression and Extraction Commands (4)

tar : Archive files.

unzip : Extract ZIP archives.

gzip : Compress files using gzip.

zip : Create ZIP archives.

Information Display Commands (11)

uname : Show operating system information.

hostname : Display or set the system’s host name.

dmesg : Show kernel boot messages.

uptime : Display system uptime and load.

stat : Show file or filesystem status.

du : Estimate disk space usage.

df : Report filesystem disk space usage.

top : Real‑time system resource monitor.

free : Display memory usage.

date : Show or set the system date and time.

cal : Display a calendar.

Search File Commands (4)

which : Locate a binary in the PATH.

find : Search the filesystem for files or directories.

whereis : Locate binary, source, and manual files.

locate : Find files using a prebuilt database.

User Management Commands (10)

useradd : Add a new user.

usermod : Modify an existing user’s attributes.

userdel : Delete a user.

groupadd : Add a new group.

passwd : Change a user’s password.

chage : Change password expiration.

id : Show user and group IDs.

su : Switch user identity.

visudo : Edit the /etc/sudoers file safely.

sudo : Execute commands with elevated privileges.

Basic Network Operations (11)

telnet : Remote login using the TELNET protocol.

ssh : Secure remote login.

scp : Securely copy files between hosts.

wget : Download files from the web.

ping : Test network connectivity.

route : View or set the routing table.

ifconfig : Configure network interfaces.

ifup : Bring a network interface up.

ifdown : Bring a network interface down.

netstat : Display network connections.

ss : Show socket statistics.

Advanced Network Operations (9)

nmap : Network scanning.

lsof : List open files.

mail : Send and receive email.

mutt : Email client.

nslookup : Query DNS servers.

dig : DNS lookup and diagnostics.

host : DNS query utility.

traceroute : Trace the route packets take.

tcpdump : Capture network traffic.

Disk and Filesystem Commands (16)

mount : Mount a filesystem.

umount : Unmount a filesystem.

fsck : Check and repair filesystems.

dd : Convert and copy files.

dumpe2fs : Dump ext2/3/4 filesystem information.

dump : Backup ext2/3/4 filesystems.

fdisk : Partition disks up to 2 TB.

parted : Partition disks without size limits.

mkfs : Create a filesystem.

partprobe : Inform the kernel of partition table changes.

e2fsck : Check ext2/3/4 filesystems.

mkswap : Set up a swap area.

swapon : Enable swap.

swapoff : Disable swap.

sync : Flush filesystem buffers.

resize2fs : Resize ext2/3/4 filesystems.

System Permissions and User Authorization (4)

chmod : Change file permissions.

chown : Change file owner and group.

chgrp : Change a file’s group.

umask : Set default permission mask.

System User Login Information (7)

whoami : Show the effective username.

who : List users currently logged in.

w : Show logged‑in users and their activities.

last : Display recent login sessions.

lastlog : Show the most recent login of all users.

users : List all logged‑in users.

finger : Display detailed user information.

Built‑in Commands and Others (19)

echo : Print text or variable values.

printf : Formatted output.

rpm : Manage RPM packages.

yum : Automated RPM package management.

watch : Periodically run a command and display output.

alias : Define command aliases.

unalias : Remove command aliases.

clear : Clear the terminal screen.

history : Show command history.

eject : Eject removable media.

time : Measure command execution time.

nc : Versatile networking utility.

xargs : Build command lines from standard input.

exec : Replace the shell with a program.

export : Set environment variables.

unset : Remove variables or functions.

type : Determine how a command will be interpreted.

bc : Command‑line calculator.

System Management and Performance Monitoring (9)

chkconfig : Manage system startup services.

vmstat : Report virtual memory statistics.

mpstat : Show per‑CPU statistics.

iostat : Report I/O statistics.

sar : Collect, report, and save system activity information.

ipcs : Report inter‑process communication facilities.

ipcrm : Remove IPC objects.

strace : Trace system calls and signals.

ltrace : Trace library calls.

Shutdown / Reboot / Logout Commands (6)

shutdown : Shut down the system.

halt : Halt the system.

poweroff : Power off the machine.

logout : Exit the current shell.

exit : Exit the current shell.

Ctrl+d : Shortcut to exit the shell.

Process Management Commands (15)

bg : Resume a suspended job in the background.

fg : Bring a background job to the foreground.

jobs : List current background jobs.

kill : Terminate a process.

killall : Kill processes by name.

pkill : Kill processes by name using patterns.

crontab : Manage scheduled tasks.

ps : Snapshot of current processes.

pstree : Display processes as a tree.

nice/renice : Adjust process priority.

nohup : Run a command immune to hangups.

pgrep : Search for processes matching criteria.

runlevel : Show the current runlevel.

init : Change the system runlevel.

service : Start, stop, restart, or query system services.

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.

linuxShellcommand-lineUnix
Efficient Ops
Written by

Efficient Ops

This public account is maintained by Xiaotianguo and friends, regularly publishing widely-read original technical articles. We focus on operations transformation and accompany you throughout your operations career, growing together happily.

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.