Linux Commands — Essential CLI Reference
Every essential Linux command organized by category with common flags and one-line descriptions. Built for developers who want CLI fluency.
Navigation & File System
| Command | Description |
|---|---|
ls | List directory contents |
ls -la | Long format with hidden files |
cd | Change directory |
pwd | Print working directory (current path) |
mkdir | Create directory (and parents with -p) |
rmdir | Remove empty directory |
rm | Remove files or directories |
cp | Copy files or directories |
mv | Move or rename files |
touch | Create empty file or update timestamp |
ln | Create symbolic or hard link |
tree | Display directory tree structure |
File Operations & Text
| Command | Description |
|---|---|
cat | Print file contents to stdout |
less | Page through file interactively |
head | Print first N lines of a file |
tail | Print last N lines; -f follows in real time |
grep | Search for pattern in files |
grep -rn | Recursive numbered search |
find | Find files matching criteria |
find . -mtime | Find files modified in last 7 days |
sed | Stream editor — substitute text |
awk | Text processing and column extraction |
sort | Sort lines of a file |
uniq | Remove duplicate lines (often piped from sort) |
wc | Count lines, words, and characters |
diff | Show differences between two files |
chmod | Change file permissions |
chown | Change file owner and group |
Process Management
| Command | Description |
|---|---|
ps | List running processes |
top | Interactive process monitor |
htop | Enhanced interactive process monitor |
kill | Send signal to a process |
killall | Kill all processes by name |
pkill | Kill processes matching a pattern |
bg | Resume a stopped job in the background |
fg | Bring a background job to the foreground |
jobs | List background jobs in current shell |
nohup | Run command immune to hangups |
lsof | List open files / processes on a port |
strace | Trace system calls of a process |
Networking
| Command | Description |
|---|---|
ping | Send ICMP echo requests to test connectivity |
curl | Transfer data with HTTP/HTTPS |
curl -I | Fetch HTTP headers only |
wget | Download file from URL |
ssh | Secure shell remote login |
scp | Copy files over SSH |
rsync | Sync files efficiently over SSH |
netstat | Display network connections and listening ports |
ss | Socket statistics (faster netstat replacement) |
ip addr | Show IP addresses of network interfaces |
nmap | Network port scanner |
traceroute | Trace packet route to a host |
dig | DNS lookup tool |
nc | Netcat — read/write network connections |
Package Managers
| Command | Description |
|---|---|
apt update | Refresh package index (Debian/Ubuntu) |
apt upgrade | Upgrade all installed packages |
apt install | Install a package |
apt remove | Remove package and config |
apt-get install | Install (older apt-get syntax) |
brew install | Install package (macOS Homebrew) |
brew update | Update Homebrew formulae |
brew upgrade | Upgrade a Homebrew package |
yum install | Install package (RHEL/CentOS/Fedora) |
dnf install | Install package (modern Fedora/RHEL) |
snap install | Install a snap package |
Compression & Archives
| Command | Description |
|---|---|
tar -czf | Create gzip-compressed tarball |
tar -xzf | Extract gzip tarball |
tar -tzf | List tarball contents without extracting |
zip -r | Create zip archive |
unzip | Extract zip archive |
gzip | Compress a file in-place (.gz) |
gunzip | Decompress a .gz file |
Build CLI Muscle Memory
The fastest terminal users don't think about commands — they just type. That fluency comes from repetition. Combine this reference with CodeSpeedTest's real code snippets (shell scripts, CI configs) to build genuine CLI speed.
Practice typing these in CodeSpeedTest →
Bash scripts, Dockerfiles, and YAML configs are all available on CodeSpeedTest. Type real shell code to build terminal fluency.