Comprehensive Linux Command Reference Guide
This guide provides a detailed overview of essential Linux command‑line utilities—including ls, mv, cp, scp, rm, touch, vi, find, grep, tar, and many others—explaining their common options, usage examples, and practical tips for system administration and everyday shell tasks.
This document presents a concise reference for frequently used Linux commands, organized by functionality.
File listing and manipulation
ls [options] [directory]
# Example options:
# -a show all files including hidden ones
# -l long format with details
# -c sort by ctime
# --color[=WHEN] colorize output (never|always|auto)Moving and renaming files
mv [options] source target
# Options:
# -b backup before overwriting
# -f force overwrite without prompting
# -i interactive, ask before overwriting
# -u overwrite only if source is newerCopying files and directories
cp [options] source target
# Options:
# -r, -R copy directories recursively
# -p preserve file attributes
# -f force copy without prompting
# -a archive mode (preserve all attributes)Secure copy between hosts
scp [options] source destination
# Options:
# -r copy directories recursively
# -v verbose output
# Example:
# scp file.txt user@remote:/path/
# scp -r dir/ user@remote:/path/Removing files and directories
rm [options] file
# Options:
# -r remove directories recursively
# -f force removal without prompts
# -i interactive, ask before each removal
# -v verbose outputCreating and updating timestamps
touch [options] file
# Options:
# -a change only access time
# -m change only modification time
# -t specify explicit timestamp (e.g., 202311150930.50)Navigation commands
pwd # print current directory
cd [dir] # change directory (.. for parent, / for root)Directory management
mkdir [options] dir
# -p create parent directories as needed
# -m set directory permissions (e.g., 777)File inspection and processing
cat [options] file # display file contents
nl [options] file # number lines
head [options] file # show beginning of file
tail [options] file # show end of fileSearching and pattern matching
grep [options] pattern file
# -c count matching lines
# -i case‑insensitive
# -l list matching file names
# -v invert match (show non‑matching lines)Archiving and compression
tar [options] archive files
# -c create archive
# -x extract archive
# -z gzip compression
# -j bzip2 compression
# -v verbose listing
# -f specify archive name gzip [options] file
# -d decompress
# -c write output to stdout
# -# compression level (1‑9)System monitoring
ps [options] # snapshot of current processes
top [options] # interactive process viewer
free [options] # memory usage
vmstat # virtual memory statisticsNetwork utilities
ifconfig [interface] # view or configure network interfaces
ping [options] host # test connectivity
netstat [options] # network statisticsScheduling tasks
crontab -e # edit user crontab
at 12:30 # schedule a one‑time job
watch -n 5 command # repeat command every 5 secondsOverall, the guide serves as a quick‑reference cheat‑sheet for system administrators and developers working in a Unix‑like environment.
DevOps Operations Practice
We share professional insights on cloud-native, DevOps & operations, Kubernetes, observability & monitoring, and Linux systems.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.