Operations 23 min read

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.

DevOps Operations Practice
DevOps Operations Practice
DevOps Operations Practice
Comprehensive Linux Command Reference Guide

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 newer

Copying 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 output

Creating 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 file

Searching 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 statistics

Network utilities

ifconfig [interface]    # view or configure network interfaces
ping [options] host   # test connectivity
netstat [options]     # network statistics

Scheduling tasks

crontab -e            # edit user crontab
at 12:30               # schedule a one‑time job
watch -n 5 command    # repeat command every 5 seconds

Overall, the guide serves as a quick‑reference cheat‑sheet for system administrators and developers working in a Unix‑like environment.

Linuxshellcommand lineUnixSystem Administrationterminal
DevOps Operations Practice
Written by

DevOps Operations Practice

We share professional insights on cloud-native, DevOps & operations, Kubernetes, observability & monitoring, and Linux systems.

0 followers
Reader feedback

How this landed with the community

login 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.