Fundamentals 16 min read

150 Essential Linux Commands Every Programmer Should Know

This article provides a comprehensive reference of 150 Linux commands, grouped by function such as file operations, system monitoring, networking, user management, and process control, each with concise English descriptions that explain their purpose and typical usage for developers and system administrators.

Linux Tech Enthusiast
Linux Tech Enthusiast
Linux Tech Enthusiast
150 Essential Linux Commands Every Programmer Should Know

Introduction

Linux commands are the core tools for managing a Linux system. Like DOS commands, they allow interaction with files, devices, processes, and system resources. The article lists essential commands that every Linux user should know.

Online Query and Help Commands (2)

man – View the manual page for a command; the command dictionary. More complex help is provided by info, which is less commonly used.

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

File and Directory Operations (18)

ls – List directory contents and their 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 working directory.

rename – Rename a file.

File Content Viewing and Manipulation (21)

cat – Concatenate files and display them on the screen or redirect to another file.

tac – Reverse version of cat; display file contents in reverse order.

more – Paginated display of file contents.

less – Paginated display, the opposite usage of more.

head – Show the beginning of a file.

tail – Show the end of a file.

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 side by side.

sort – Sort text lines.

uniq – Remove duplicate lines.

wc – Count lines, words, or bytes.

iconv – Convert file encoding.

dos2unix – Convert DOS‑format files to UNIX format.

File Comparison (4)

diff – Show differences between files, commonly used for text files.

vimdiff – Visual file comparison in the terminal, often used for text files.

File Compression and Archiving (4)

tar – Create and manipulate archive files.

unzip – Extract files from a zip archive.

gzip – Compress files using the gzip algorithm.

zip – Create zip archives.

System Information Commands (11)

uname – Display operating‑system information.

hostname – Show or set the system’s host name.

dmesg – Print kernel ring buffer messages, useful for diagnosing boot problems.

uptime – Show how long the system has been running and its load average.

stat – Display file or filesystem status.

du – Estimate file space usage.

df – Report filesystem disk space usage.

top – Real‑time display of system resource usage.

free – Show memory usage.

date – Display or set the system date and time.

cal – Show a calendar.

Basic Network Operations (11)

telnet – Remote login using the TELNET protocol.

ssh – Secure remote login using the SSH protocol.

scp – Securely copy files between hosts.

wget – Download files from the web.

ping – Test network connectivity between hosts.

route – View or modify the kernel routing table.

ifconfig – View and configure network interfaces.

ifup – Bring a network interface up.

ifdown – Bring a network interface down.

netstat – Display network connections, routing tables, and interface statistics.

ss – Another tool to display socket statistics.

Advanced Network Operations (9)

nmap – Network scanner.

lsof – List open files.

mail – Send and receive email.

mutt – Command‑line email client.

nslookup – Interactive DNS query.

dig – Detailed DNS lookup.

host – Simple DNS query.

traceroute – Trace the route packets take to a network host.

tcpdump – Command‑line packet capture tool.

Disk and Filesystem Commands (16)

mount – Mount a filesystem.

umount – Unmount a filesystem.

fsck – Check and repair a Linux filesystem.

dd – Convert and copy files, often used for low‑level copying.

dumpe2fs – Dump ext2/3/4 filesystem information.

dump – Backup ext2/3/4 filesystems.

fdisk – Partition disks up to 2 TB.

parted – Partition disks without the 2 TB limit.

mkfs – Create a filesystem.

partprobe – Inform the kernel of partition table changes.

e2fsck – Check ext2/3/4 filesystems.

mkswap – Create a swap partition.

swapon – Enable a swap partition.

swapoff – Disable a swap partition.

sync – Flush buffered data to disk.

resize2fs – Resize ext2/3/4 filesystems.

System Permissions and Authorization (4)

chmod – Change file or directory permissions.

chown – Change file or directory owner and group.

chgrp – Change group ownership.

umask – Set the default permission mask for newly created files.

User Login Information (7)

whoami – Print the effective username.

who – Show who is currently logged in.

w – Show logged‑in users and their running processes.

last – Display a list of recent logins.

lastlog – Show the most recent login of all users.

users – List usernames of users currently logged in.

finger – Retrieve information about a user.

Built‑in Shell Commands and Miscellaneous (19)

echo – Print arguments to standard output.

printf – Format and print data.

rpm – Manage RPM packages.

yum – High‑level package manager for RPM‑based systems.

watch – Execute a program periodically, showing output fullscreen.

alias – Define command aliases.

unalias – Remove command aliases.

date – Show or set the system date and time.

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 the specified command.

export – Set environment variables.

unset – Remove variables or functions.

type – Determine if a command is built‑in, an alias, or an external program.

bc – Command‑line calculator.

System Management and Performance Monitoring (9)

chkconfig – Manage system services at boot time.

vmstat – Report virtual memory statistics.

mpstat – Report per‑CPU statistics.

iostat – Report CPU and I/O statistics.

sar – Collect, report, or save system activity information.

ipcs – Report inter‑process communication facilities status.

ipcrm – Remove IPC objects.

strace – Trace system calls and signals.

ltrace – Trace library calls.

Shutdown, Reboot, and Session Commands (6)

shutdown – Shut down the system.

halt – Halt the system.

poweroff – Power off the system.

logout – Exit the current login shell.

exit – Exit the current shell.

Ctrl+d – Shortcut to exit the current shell.

Process Management (15)

bg – Resume a stopped job in the background.

fg – Bring a background job to the foreground.

jobs – List active jobs.

kill – Send a signal to terminate a process.

killall – Kill processes by name.

pkill – Kill processes matching a pattern.

crontab – Schedule recurring tasks.

ps – Snapshot of current processes.

pstree – Tree view of processes.

nice/renice – Adjust process priority.

nohup – Run a command immune to hangup signals.

pgrep – Search for processes matching criteria.

runlevel – Show the current system runlevel.

init – Change the system runlevel.

service – Start, stop, restart, or query the status of system services.

Source: Operations Network (运维网工)

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.

Process ManagementLinuxShellCommand LineNetworkingSystem Administration
Linux Tech Enthusiast
Written by

Linux Tech Enthusiast

Focused on sharing practical Linux technology content, covering Linux fundamentals, applications, tools, as well as databases, operating systems, network security, and other technical knowledge.

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.