Forever & AlwaysLINUX COMMAND ATLAS
LINUX COMMAND ATLAS · FIELD GUIDE

Linux commands,
made clear.

Search common Linux terminal commands, understand what they do, and adapt practical examples for your system.

⌘Clear, practical examples文English + 中文
EXAMPLE COMMANDS
❯find . -type f -name "*.log"
# Find log files in the current directory
❯grep -Rni "error" ./logs
# Search their contents for “error”

Linux command reference in English and Chinese

Forever & Always presents Linux Command Atlas, a practical guide to Linux shell commands. Browse examples for files and directories, search, text processing, permissions, processes, system services, networking and archives. Use the command search to find tools such as ls, grep, find, chmod, systemctl, ssh and tar, then check your distribution’s manual before running them.

THE COMMAND LIBRARY

Your terminal, decoded.

Useful commands, explained without the guesswork.

56commands
+

pwd

Getting started

Print the full path of your current working directory.

pwd
Shell builtinUsage & options

ls

Getting started

List files and folders. Add flags to show hidden files and details.

ls -lah
GNU CoreutilsUsage & options

cd

Getting started

Move to another directory. Use “cd -” to return to the previous one.

cd /var/log
Shell builtinUsage & options

whoami

Getting started

Print the username associated with the current effective user ID.

whoami
GNU CoreutilsUsage & options

id

Getting started

Show user and group IDs for the current user or another account.

id
GNU CoreutilsUsage & options

clear

Getting started

Clear the visible contents of the terminal screen.

clear

history

Getting started

Show commands recorded by your shell in the current history list.

history | tail -n 15
Shell builtinUsage & options

man

Getting started

Open the manual page for a command. Press q to leave the viewer.

man find
Linux man-pagesUsage & options

mkdir

Files & folders

Create a directory. The -p flag also creates missing parent directories.

mkdir -p ./project/logs
GNU CoreutilsUsage & options

touch

Files & folders

Create an empty file, or update an existing file’s modification time.

touch notes.txt
GNU CoreutilsUsage & options

cp

Files & folders

Copy files. Add -r when copying a directory and its contents.

cp -r ./assets ./backup/assets
GNU CoreutilsReview carefully before runningUsage & options

mv

Files & folders

Move or rename files and directories.

mv draft.txt notes.txt
GNU CoreutilsReview carefully before runningUsage & options

rm

Files & folders

Remove files. This does not normally move them to a recoverable trash folder.

rm -i ./old-notes.txt
GNU CoreutilsReview carefully before runningUsage & options

ln

Files & folders

Create a link. Use -s to create a symbolic link.

ln -s /opt/app ./app
GNU CoreutilsUsage & options

stat

Files & folders

Display detailed metadata about a file or directory.

stat ./report.csv
GNU CoreutilsUsage & options

file

Files & folders

Identify a file’s type by examining its contents and metadata.

file ./download.bin
file utilityUsage & options

find

Find & search

Search a directory tree by name, type, age, and other conditions.

find . -type f -name "*.log"
find manualUsage & options

grep

Find & search

Search text for a pattern. Use -R for directories and -n to show line numbers.

grep -Rni "error" ./logs

locate

Find & search

Find paths using a prebuilt filename database; results may need updating.

locate ssh_config
mlocate/plocateUsage & options

which

Find & search

Show which executable would run when you enter a command name.

which python3
which manualUsage & options

cat

Text & data

Print file contents to the terminal or join multiple files together.

cat ./config.ini
GNU CoreutilsUsage & options

less

Text & data

Read long text one screen at a time. Search with / and quit with q.

less /var/log/syslog
less manualUsage & options

head

Text & data

Show the first lines of a file; use -n to choose how many.

head -n 20 access.log
GNU CoreutilsUsage & options

tail

Text & data

Show the last lines of a file. Use -f to follow new lines as they arrive.

tail -f ./app.log
GNU CoreutilsUsage & options

wc

Text & data

Count lines, words, and bytes. Use -l for a line count only.

wc -l access.log
GNU CoreutilsUsage & options

sort

Text & data

Sort lines of text. Add -n for numeric order or -r for reverse order.

sort -n scores.txt
GNU CoreutilsUsage & options

uniq

Text & data

Report or remove adjacent repeated lines; sort first to group matches.

sort names.txt | uniq -c
GNU CoreutilsUsage & options

cut

Text & data

Extract selected fields or character ranges from each input line.

cut -d, -f1,3 users.csv
GNU CoreutilsUsage & options

sed

Text & data

Transform text streams; this example prints matching lines without editing files.

sed -n "/WARN/p" app.log

awk

Text & data

Process text by fields and patterns; fields are separated by whitespace by default.

awk '{print $1}' access.log

ps

System & processes

Show a snapshot of processes. This format lists processes for all users.

ps aux

top

System & processes

View a live, interactive summary of processes and resource use.

top

free

System & processes

Display memory use. The -h flag chooses human-readable units.

free -h

df

System & processes

Show available and used disk space for mounted filesystems.

df -h
GNU CoreutilsUsage & options

du

System & processes

Estimate directory space use. Here, list direct children in readable units.

du -sh ./*
GNU CoreutilsUsage & options

uname

System & processes

Print system information. The -a flag requests the available details.

uname -a
GNU CoreutilsUsage & options

uptime

System & processes

Show how long the system has been running and its load averages.

uptime

systemctl

System & processes

Inspect or manage systemd services. Service names vary by distribution.

systemctl status ssh

journalctl

System & processes

Read systemd journal entries. Use -u to filter by service unit.

journalctl -u ssh --since today

ip

Network

Inspect or configure network interfaces, addresses, and routes.

ip address show

ping

Network

Send diagnostic echo requests to test network reachability.

ping -c 4 example.com

ss

Network

Show socket information. The flags below list listening TCP and UDP ports.

ss -tuln

curl

Network

Transfer data to or from a URL; -I requests response headers only.

curl -I https://example.com
curl manualUsage & options

wget

Network

Retrieve a file from a URL. Check the source before downloading or running it.

wget https://example.com/file.tar.gz
GNU WgetReview carefully before runningUsage & options

ssh

Network

Connect securely to a remote machine using its account and host name.

ssh user@server.example

scp

Network

Copy files between hosts over SSH. Check both source and destination paths.

scp ./report.txt user@host:/tmp/
OpenSSHReview carefully before runningUsage & options

dig

Network

Query DNS records and inspect the response returned by a DNS server.

dig example.com
BIND utilitiesUsage & options

tar

Archives

Create or inspect tar archives. This example lists files without extracting them.

tar -tf backup.tar.gz

gzip

Archives

Compress a file with gzip. By default, the input file is replaced by its compressed form.

gzip -k report.log

zip

Archives

Create a ZIP archive. Add -r when including a directory tree.

zip -r site-backup.zip ./site

unzip

Archives

List or extract ZIP contents. Inspect untrusted archives before extraction.

unzip -l site-backup.zip
Info-ZIPReview carefully before runningUsage & options

xz

Archives

Compress files using xz. The -k flag keeps the original file.

xz -k data.csv

chmod

Permissions

Change file permissions. This example grants the owner execute permission.

chmod u+x ./script.sh
GNU CoreutilsReview carefully before runningUsage & options

chown

Permissions

Change file ownership. Use elevated privileges only when needed.

sudo chown user:group ./file
GNU CoreutilsReview carefully before runningUsage & options

sudo

Permissions

Run an approved command with elevated privileges. Check the command before confirming.

sudo systemctl status ssh
sudo manualReview carefully before runningUsage & options

groups

Permissions

Show the groups to which a user account belongs.

groups
GNU CoreutilsUsage & options
Pause before you press Enter.

Commands can change or permanently remove data. Read each example, check the target path, and consult your system’s manual before running anything you do not understand.

How to read man pages
FOREVER & ALWAYS · WEBSITE INFORMATION