Operations 15 min read

Comprehensive List of Common Linux Commands

This article provides a detailed, English‑translated reference of essential Linux command‑line tools covering file management, content viewing, compression, system information, networking, user administration, permissions, process control, and system monitoring, useful for both beginners and experienced administrators.

Selected Java Interview Questions
Selected Java Interview Questions
Selected Java Interview Questions
Comprehensive List of Common Linux Commands

Linux commands are essential for managing the operating system, covering files, directories, processes, networking, user accounts, permissions, and system monitoring.

Online Help and Query Commands (2)

man: view command help (manual pages); help: view built‑in command help such as for 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/directories.

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‑like structure.

basename: display the file name component of a path.

dirname: display the directory component of a path.

chattr: change extended file attributes.

lsattr: list extended file attributes.

file: determine the type of a file.

md5sum: compute and verify an MD5 checksum.

File Content Viewing and Processing (21)

cat: concatenate and display file contents.

tac: display file contents in reverse order.

more: paginate output of file contents.

less: paginate 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 of files side by side.

sort: sort text lines.

uniq: filter out 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 file comparison using Vim.

rev: reverse each line of a file.

grep/egrep: filter lines matching patterns.

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

tr: translate or delete characters.

vi/vim: command‑line text editors.

Compression and Decompression (4)

tar: archive files (optionally with compression).

unzip: extract ZIP archives.

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: display kernel boot messages.

uptime: show system uptime and load average.

stat: display file or filesystem status.

du: estimate file space usage.

df: report filesystem disk space usage.

top: real‑time view of system processes and resource usage.

free: display memory usage.

date: show or set the system date and time.

cal: display a calendar.

File Search Commands (4)

which: locate an executable in the PATH.

find: recursively search for files or directories.

whereis: locate binary, source, and manual pages.

locate: find files using a prebuilt database (updated with updatedb).

User Management Commands (10)

useradd: create a new user.

usermod: modify an existing user.

userdel: delete a user.

groupadd: create a new group.

passwd: change a user's password.

chage: change password expiry information.

id: display a user's UID, GID, and groups.

su: switch user identity.

visudo: safely edit the /etc/sudoers file.

sudo: execute commands with elevated privileges.

Basic Network Operations (11)

telnet: remote login using the Telnet protocol.

ssh: secure remote login using SSH.

scp: securely copy files between hosts.

wget: download files from the command line.

ping: test network connectivity.

route: view or modify the routing table.

ifconfig: configure network interfaces.

ifup: bring a network interface up.

ifdown: bring a network interface down.

netstat: display network connections and routing tables.

ss: another utility to investigate sockets.

Advanced Network Operations (9)

nmap: network scanning and host discovery.

lsof: list open files and the processes using them.

mail: send and receive email.

mutt: terminal‑based email client.

nslookup: query DNS servers interactively.

dig: DNS lookup and diagnostic tool.

host: simple DNS query utility.

traceroute: trace the path packets take to a destination.

tcpdump: capture and analyze network traffic.

Disk and Filesystem Commands (16)

mount: mount a filesystem.

umount: unmount a filesystem.

fsck: check and repair a filesystem.

dd: convert and copy raw data.

dumpe2fs: dump ext2/3/4 filesystem information.

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: set up a swap area.

swapon: enable swap.

swapoff: disable swap.

sync: flush filesystem buffers.

resize2fs: resize ext2/3/4 filesystems.

Permission and Ownership Commands (4)

chmod: change file mode (permissions).

chown: change file owner and group.

chgrp: change group ownership.

umask: set default permission mask.

Login Information Commands (7)

whoami: display the effective username.

who: list users currently logged in.

w: show logged‑in users and their processes.

last: display recent login history.

lastlog: show the most recent login of all users.

users: list usernames of users currently logged in.

finger: display detailed user information.

Built‑in and Miscellaneous Commands (19)

echo: output text or variable values.

printf: format and output data.

rpm: manage RPM packages.

yum: high‑level package manager for RPM‑based systems.

watch: repeatedly execute a command and display its output.

alias/unalias: define or remove command aliases.

date: display or set the system date and time.

clear: clear the terminal screen.

history: show command history.

eject: eject removable media.

time: measure execution time of a command.

nc: versatile networking utility (netcat).

xargs: build and execute command lines from standard input.

exec: replace the shell with a specified command.

export/unset: set or remove environment variables.

type: indicate how a command would be interpreted.

bc: command‑line calculator.

System Management and Performance Monitoring (9)

chkconfig: manage system services at boot.

vmstat: report virtual memory statistics.

mpstat: display per‑CPU statistics.

iostat: report CPU and I/O statistics.

sar: collect, report, or save system activity information.

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, and Logout Commands (6)

shutdown/halt/poweroff: power‑off the system.

logout/exit/Ctrl+D: exit the current shell session.

Process Management Commands (15)

bg/fg: move jobs between background and foreground.

jobs: list current jobs.

kill/killall/pkill: terminate processes by PID or name.

crontab: schedule recurring tasks.

ps/pstree: display process snapshots and hierarchies.

nice/renice: adjust process priority.

nohup: run a command immune to hangups.

pgrep: search for processes by name.

runlevel/init: view or change the system runlevel.

service: start, stop, 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-lineUnixSystem Administration
Selected Java Interview Questions
Written by

Selected Java Interview Questions

A professional Java tech channel sharing common knowledge to help developers fill gaps. Follow us!

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.