Operations 25 min read

150 Essential Linux Commands Every Sysadmin Should Master

This comprehensive guide lists 150 indispensable Linux commands covering file management, system monitoring, networking, user administration, process control, and more, providing clear explanations to help both beginners and experienced administrators efficiently manage Linux environments.

Linux Cloud Computing Practice
Linux Cloud Computing Practice
Linux Cloud Computing Practice
150 Essential Linux Commands Every Sysadmin Should Master

Online Query and Help Commands

man : Full name manual, used to view various reference manuals built into the system.

help : Displays help information for shell internal commands.

File and Directory Operations

ls : List directory contents and their attribute information.

cd : Change the current working directory to the specified path; "~" denotes the home directory, "." the current directory, and ".." the parent directory.

cp : Copy files or directories.

find : Search for files within a specified directory hierarchy.

mkdir : Create directories.

mv : Move or rename files.

pwd : Print the absolute path of the current working directory.

rename : Batch rename files using string replacement.

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

rmdir : Remove empty directories.

touch : Change file timestamps or create a new empty file if it does not exist.

tree : Display directory contents in a tree-like diagram.

basename : Show the filename, stripping directory path and suffix.

dirname : Show the directory portion of a given path.

chattr : Change file attributes.

lsattr : List file attributes.

file : Identify file types.

md5sum : Generate and verify MD5 checksums for file integrity.

File Viewing and Content Processing Commands

cat : Concatenate and display file contents.

tac : Reverse the order of file lines (last line first).

more : Paginated display of file contents with basic navigation and search.

less : Flexible file viewer allowing forward and backward navigation without preloading the entire file.

head : Show the beginning of a file (default first 10 lines).

tail : Show the end of a file; "-f" follows a file as it grows.

cut : Split each line of a file by a delimiter and output selected fields.

split : Divide a file into smaller pieces.

paste : Merge lines of files column-wise.

sort : Sort text file contents line by line.

uniq : Remove duplicate lines from a sorted file.

wc : Count lines, words, or bytes in a file.

iconv : Convert file encoding.

dos2unix : Convert Windows line endings (\r\n) to Unix/Linux line endings (\n).

diff : Compare files line by line.

vimdiff : Visual file comparison tool using Vim.

rev : Reverse each line character-wise.

grep/egrep : Search text using patterns or regular expressions.

join : Join lines of two files on a common field.

tr : Translate or delete characters from input.

vi/vim : Standard text editors on Unix/Linux, with Vim offering advanced features for programming.

File Compression and Extraction Commands

tar : Create and extract archive files.

unzip : Extract ZIP archives.

gzip : Compress files, adding a ".gz" extension.

zip : Create ZIP archives.

System Information Commands

uname : Display system information.

hostname : Show or set the system's host name.

dmesg : Display kernel boot messages and diagnose system issues.

uptime : Show system uptime and load.

stat : Display file and filesystem status.

du : Show disk usage of files or directories.

df : Report filesystem disk space usage.

top : Real-time system monitor showing process resource usage.

free : Display memory and swap usage.

date : Show or set the system date and time.

cal : Display a calendar.

File Search Commands

which : Locate a command in the directories listed in $PATH.

find : Search for files or directories in the filesystem.

whereis : Locate source, binary, and manual files for a command.

locate : Find files using a prebuilt database (faster than find).

User Management Commands

useradd : Create a new user account.

usermod : Modify existing user attributes.

userdel : Delete a user account.

groupadd : Create a new user group.

passwd : Change a user's password.

chage : Modify password expiration information.

id : Show user and group IDs.

su : Switch to another user account.

visudo : Safely edit the sudoers file.

sudo : Execute commands with elevated privileges.

Basic Network Operations

telnet : Remote login using the TELNET protocol.

ssh : Secure remote login using SSH.

scp : Securely copy files between hosts over SSH.

wget : Download files from a URL.

ping : Test network connectivity between hosts.

route : Display and modify the routing table.

ifconfig : Configure network interfaces (requires root).

ifup : Bring a network interface up.

ifdown : Bring a network interface down.

netstat : Show network status and connections.

ss : Display socket statistics, similar to netstat but faster.

Advanced Network Operations

nmap : Network scanner and mapper for security testing.

lsof : List open files, including network connections.

mail : Send and receive email.

mutt : Email management utility.

nslookup : Interactive DNS query tool.

dig : DNS lookup utility for testing name resolution.

host : Simple DNS lookup tool.

traceroute : Trace the path packets take to a host.

tcpdump : Capture and analyze network packets.

Disk and Filesystem Commands

mount : Mount external filesystems.

umount : Unmount filesystems.

fsck : Check and repair inconsistent filesystems.

parted : Partition disks, supporting large (>2 TB) disks with GPT.

mkfs : Create a filesystem on a device.

partprobe : Re-read partition table from the kernel.

e2fsck : Check ext2/ext3/ext4 filesystems.

mkswap : Set up a swap area.

swapon : Enable a swap partition.

swapoff : Disable a swap partition.

sync : Flush filesystem buffers to disk.

resize2fs : Resize ext2/ext3/ext4 filesystems.

System Permissions and Authorization

chmod : Change file permission modes.

chown : Change file owner and group.

chgrp : Change group ownership of a file or directory.

umask : Set or display the default permission mask for new files.

User Login Information Commands

whoami : Show the current effective username.

who : Display currently logged-in users.

w : Show logged-in users and their running processes.

last : Show recent login history.

lastlog : Display the most recent login of all users.

users : List all logged-in users.

finger : Show detailed information about logged-in users.

Built‑in and Miscellaneous Commands

echo : Print variables or strings.

printf : Format and output data.

rpm : Manage RPM packages.

yum : Front‑end package manager for RPM‑based distributions.

watch : Periodically execute a command and display its output.

alias : Define command aliases.

unalias : Remove command aliases.

clear : Clear the terminal screen.

history : Show command history.

eject : Eject removable media.

time : Measure the execution time of a command.

nc : Netcat, a versatile networking utility.

xargs : Build and execute command lines from standard input.

exec : Replace the shell with a specified command.

export : Set or display environment variables.

unset : Remove variables or functions.

type : Show how a command would be interpreted (builtin, file, etc.).

bc : Arbitrary‑precision calculator language.

System Management and Performance Monitoring

chkconfig : Check and configure system services.

vmstat : Report virtual memory statistics.

mpstat : Report per‑processor statistics.

iostat : Report CPU and I/O statistics.

sar : System Activity Reporter for comprehensive performance data.

ipcs : Report inter‑process communication facilities.

ipcrm : Remove IPC objects.

strace : Trace system calls and signals of a process.

ltrace : Trace library calls of a process.

Shutdown, Reboot, Logout and System Info Commands

shutdown : Power off or reboot the system, optionally sending a warning message.

halt : Halt the system.

poweroff : Power off the machine.

logout : Exit the current shell session.

exit : Exit the current shell session.

Ctrl+d : Shortcut to exit the current shell.

Process Management Commands

bg : Resume a suspended background job.

fg : Bring a background job to the foreground.

jobs : List current background jobs.

kill : Terminate a process.

killall : Terminate all processes with a given name.

pkill : Kill processes by name.

crontab : Schedule recurring tasks.

ps : Display a snapshot of current processes.

pstree : Show processes as a tree.

nice / renice : Adjust process scheduling priority.

nohup : Run a command immune to hangups.

pgrep : Search for processes by name.

runlevel : Show the current system runlevel.

init : Change the system runlevel.

service : Manage system services (start, stop, restart, status).

operationsshellCommand LineUnix
Linux Cloud Computing Practice
Written by

Linux Cloud Computing Practice

Welcome to Linux Cloud Computing Practice. We offer high-quality articles on Linux, cloud computing, DevOps, networking and related topics. Dive in and start your Linux cloud computing journey!

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.