Show directory sizes sorted
Useful Linux one-liner
du -sh * | sort -hr
Linux basics
126 Text Processing Linux command examples grouped into 8 practical sections.
Browse grouped command cards or search directly below.
59 commands
Useful Linux one-liner
du -sh * | sort -hr
Useful Linux one-liner
< /dev/urandom tr -dc A-Za-z0-9 | head -c 32; echo
Useful Linux one-liner
wc -l file.txt
Useful Linux one-liner
sort file | uniq
Useful Linux one-liner
tail -f logfile
Useful Linux one-liner
nl file.txt
Useful Linux one-liner
command | pv -s $(du -b input | cut -f1)
Useful Linux one-liner
history | awk '{print $2}' | sort | uniq -c | sort -nr | head
Translate awk scripts to Perl
a2p [script.awk] > [script.pl]
Pattern scanning and text processing language
awk '{print $5}' [path/to/file]
Text-based science fiction adventure game
battlestar
CSV column selector and reorderer
csvcut -c [1,3,5] [data.csv]
view logs from a container
docker container logs [container]
disk usage analyzer
du -sh [directory]
show changes in tracked data files
dvc diff
GNU implementation of AWK text processor
gawk '{print $1, $3}' [path/to/file]
Export the current HEAD of the git repository to a zip archive
git archive-file
Create archives of repository files without version control metadata
git archive HEAD -o [archive.tar]
Soft reset keeping staged changes
git clear-soft
Reset and clean working directory
git clear
List unpushed local commits
git local-commits
Check out GitLab merge requests
git mr [51]
Record and recover reference movements
git reflog
Reset current HEAD to a specified state
git reset [file]
List commit objects in reverse chronological order
git rev-list HEAD
Pick out and massage parameters for other git commands
git rev-parse HEAD
Squash a branch into a single commit
git squash [branch]
Read and modify symbolic references like HEAD
git symbolic-ref HEAD
outputs the first 10 lines of each FILE to standard output
head path/to/file
preserves the first line of a file while passing the remaining lines through
keep-header [file] -- sort
TUI for viewing logs from journald, Docker, and Kubernetes
lazyjournal
terminal pager program used to view the contents of text files one
less [file]
like awk, sed, cut, join, and sort for name-indexed data such as CSV
mlr --csv --ojson cat [file.csv]
processes structured text data
mlr --csv --ojson cat [data.csv]
filters PO file translations through a command
msgfilter [sed -e 's/old/new/g'] < [input.po] > [output.po]
network-capable Tetris game
netris
45 commands
Useful Linux one-liner
du -h . | sort -hr | head -20
Useful Linux one-liner
ls | wc -l
Postman-like API client for the terminal
atac
Filter and search BGP routing data in MRT format
bgpgrep [path/to/rib.mrt.gz] -subnet [192.0.2.0/24]
combine lines of two files using boolean operations
combine [file1] and [file2]
GNU core Unix utilities collection
coreutils --help
CSV to tab-separated values converter
csv2tsv [input.csv] > [output.tsv]
Suite of command-line CSV processing tools
csvlook [data.csv]
Agentless SSH-based DevOps command center for Linux infrastructure
pip install deflect-one
switch branches or restore working tables
dolt checkout [branch_name]
kernel random number generator interface
head -c [16] /dev/urandom | xxd
Copy files from index to working directory
git checkout-index -a
Switch branches or restore working tree files
git checkout [branch-name]
Compare tree to working tree or index
git diff-index HEAD
List tree object contents
git ls-tree HEAD
Create tree object from ls-tree format
git ls-tree HEAD | git mktree
terminal-based graphical activity monitor written in Node
gtop
performs print head cleaning on HP printers
hp-clean
minimalist filesystem-based IRC client
ii -s [irc.libera.chat] -n [nickname]
command-line JSON processor
cat [data.json] | jq '.'
prints container logs from a pod
kubectl logs [pod-name]
tails logs from multiple pods simultaneously
kubetail [pod-name-prefix]
CLI tool for log stream splitting and visualization
tail -f [logfile] | logss -c "[pattern1]" -c "[pattern2]"
Fast minimalist directory tree viewer
lstr
command-line HTTP client from the LWP suite
lwp-request [https://example.com/]
Heap consistency checking for malloc
mcheck(NULL)
Fast remote-first multi-host TUI log viewer with timeline histogram
nerdlog [user]@[host]
command-line Git information tool that displays repository summary with ASCII
onefetch
inspects Apache Parquet files
parquet-tools schema [file.parquet]
The Perl 5 language interpreter
perl [script.pl]
Lossy PNG compression via color quantization
pngquant --quality=[65-80] [image.png]
Reduce color count in PNM images
pnmquant [256] [input.pnm] > [output.pnm]
Convert Perl POD documentation to HTML
pod2html --infile=[file.pod] --outfile=[file.html]
Shut down and power off the system
poweroff
Stream pueue task output in real-time
pueue follow [task_id]
Manage DNS resolver configuration dynamically
resolvconf -u
29 commands
Useful Linux one-liner
telnet towel.blinkenlights.nl
Useful Linux one-liner
sed -i 's/old/new/g' *.txt
Sort package index files
apt-sortpkgs [Packages] > [Packages.sorted]
Manage tables and items in Amazon DynamoDB.
aws dynamodb create-table --table-name [my-table] --attribute-definitions AttributeName=id,AttributeType=S --key-schema AttributeName=id,KeyType=HASH --billing-mode PAY_PER_REQUEST
Real-time container metrics monitor
ctop -a
extract sections from lines of files
cut -f [1,3] [file.txt]
standard Unix line editor
ed [file.txt]
Terminal-based sequence editor for git interactive rebase
git rebase -i HEAD~5
Generate a pull request summary for email submission
git request-pull [start] [url]
Summarize git log output grouped by author
git shortlog
graph stream editor, similar to awk for graphs
gvpr -f [script.gvpr] [input.gv]
displays bandwidth usage on a network interface, broken down by connection
sudo iftop
allows mouse cursor control using the keyboard
keynav
micro GNU Emacs-style editor
mg [file.txt]
extracts specific fields from input
echo "[a b c]" | nth [2]
Generate color palette from PNM images
pnmcolormap [256] [image.ppm] > [colormap.ppm]
Scale PostScript images to poster size
poster -p [A0] -s [1.0] [input.ps] > [output.ps]
Mail delivery agent with recipe-based filtering
procmail < [email.txt]
Retrieve and filter Arch Linux mirror lists
sudo reflector --sort rate --save /etc/pacman.d/mirrorlist
Regular expression syntax reference
regex
UNIX shell written in pure Ruby
rubish
Ruby programming language interpreter
ruby
Stream editor for text transformations
[command] | sed 's/apple/mango/g'
Display kernel slab cache information
sudo slabtop
Translate or delete characters
echo "hello" | tr 'a-z' 'A-Z'
Topological sort of dependency pairs
tsort [dependencies.txt]
Enhanced text field cutting and splitting
echo "[a\tb\tc]" | tuc -f 1
XMLStarlet command-line XML toolkit
xml val [file.xml]
Command-line XML processing toolkit
xmlstarlet sel -t -v "[xpath]" [file.xml]
11 commands
TUI for managing Obsidian vaults and notes from the terminal
basalt
Rewrite branch history by applying filters
git filter-branch --tree-filter 'rm -f [file]' HEAD
lists cluster events
kubectl events
User-friendly socket statistics with a TUI
neoss
Batch rename utility for developers
nomino -r "[regex]" "[output_pattern]"
nushell, a modern shell with structured data
nu
Modern shell that treats data as structured information
nu
Syntax-aware grep and code editing tool
echo 'Hello World!' | srgn '[wW]orld' -- 'there'
Graphical Slurm cluster state viewer
sview
File cut, copy, and paste for terminal
xcv x [file1] [file2]
Batch rename files using zsh patterns
zmv '(*)' '${(U)1}'
9 commands
human-friendly alternative to cut and awk
echo "one two three" | choose 0
Terminal-based cryptocurrency tracker
cointop
abort any in-progress git operation (rebase, merge, cherry-pick, revert, am)
git abort
Find and replace across tracked files
git sed "[old]" "[new]"
displays all tags in the repository
jj tag list
parses JSON in shell scripts
echo '{"name":"test"}' | jshon -e name
Adjust stream buffering of commands
stdbuf -oL [command]
Unicode-aware uppercase filter
echo "[straße]" | uc
Insert text editor into pipelines
echo "text" | vipe
3 commands
List branches not yet merged into the current branch
git show-unmerged-branches
Temporarily save uncommitted changes for later
git stash
Control Transmission daemon remotely
transmission-remote -l
1 commands
Create and optionally switch to new branch
git create-branch [branch_name]
1 commands
telnet towel.blinkenlights.nl
Requires network or a remote resource.
du -h . | sort -hr | head -20
Uses pipes, overwrite, or deletion. Check paths and options first.
du -sh * | sort -hr
Uses pipes, overwrite, or deletion. Check paths and options first.
< /dev/urandom tr -dc A-Za-z0-9 | head -c 32; echo
Uses pipes, overwrite, or deletion. Check paths and options first.
wc -l file.txt
Copy it and replace filenames, paths, or keywords as needed.
sort file | uniq
Uses pipes, overwrite, or deletion. Check paths and options first.
tail -f logfile
Copy it and replace filenames, paths, or keywords as needed.
sed -i 's/old/new/g' *.txt
Copy it and replace filenames, paths, or keywords as needed.
nl file.txt
Copy it and replace filenames, paths, or keywords as needed.
command | pv -s $(du -b input | cut -f1)
Uses pipes, overwrite, or deletion. Check paths and options first.
ls | wc -l
Uses pipes, overwrite, or deletion. Check paths and options first.
history | awk '{print $2}' | sort | uniq -c | sort -nr | head
Uses pipes, overwrite, or deletion. Check paths and options first.
a2p [script.awk] > [script.pl]
Uses pipes, overwrite, or deletion. Check paths and options first.
apt-sortpkgs [Packages] > [Packages.sorted]
Uses pipes, overwrite, or deletion. Check paths and options first.
atac
Copy it and replace filenames, paths, or keywords as needed.
awk '{print $5}' [path/to/file]
Copy it and replace filenames, paths, or keywords as needed.
aws dynamodb create-table --table-name [my-table] --attribute-definitions AttributeName=id,AttributeType=S --key-schema AttributeName=id,KeyType=HASH --billing-mode PAY_PER_REQUEST
Copy it and replace filenames, paths, or keywords as needed.
basalt
Copy it and replace filenames, paths, or keywords as needed.
battlestar
Copy it and replace filenames, paths, or keywords as needed.
bgpgrep [path/to/rib.mrt.gz] -subnet [192.0.2.0/24]
May affect permissions or system state. Check the target first.
echo "one two three" | choose 0
Uses pipes, overwrite, or deletion. Check paths and options first.
cointop
Copy it and replace filenames, paths, or keywords as needed.
combine [file1] and [file2]
Copy it and replace filenames, paths, or keywords as needed.
coreutils --help
Copy it and replace filenames, paths, or keywords as needed.
csv2tsv [input.csv] > [output.tsv]
Uses pipes, overwrite, or deletion. Check paths and options first.
csvcut -c [1,3,5] [data.csv]
Copy it and replace filenames, paths, or keywords as needed.
csvlook [data.csv]
Copy it and replace filenames, paths, or keywords as needed.
ctop -a
Copy it and replace filenames, paths, or keywords as needed.
cut -f [1,3] [file.txt]
Copy it and replace filenames, paths, or keywords as needed.
pip install deflect-one
Copy it and replace filenames, paths, or keywords as needed.
docker container logs [container]
Copy it and replace filenames, paths, or keywords as needed.
dolt checkout [branch_name]
Copy it and replace filenames, paths, or keywords as needed.
du -sh [directory]
Copy it and replace filenames, paths, or keywords as needed.
dvc diff
Copy it and replace filenames, paths, or keywords as needed.
ed [file.txt]
Copy it and replace filenames, paths, or keywords as needed.
gawk '{print $1, $3}' [path/to/file]
Copy it and replace filenames, paths, or keywords as needed.
head -c [16] /dev/urandom | xxd
Uses pipes, overwrite, or deletion. Check paths and options first.
git abort
Copy it and replace filenames, paths, or keywords as needed.
git archive-file
Copy it and replace filenames, paths, or keywords as needed.
git archive HEAD -o [archive.tar]
Copy it and replace filenames, paths, or keywords as needed.
git checkout-index -a
Copy it and replace filenames, paths, or keywords as needed.
git checkout [branch-name]
Copy it and replace filenames, paths, or keywords as needed.
git clear-soft
Copy it and replace filenames, paths, or keywords as needed.
git clear
Copy it and replace filenames, paths, or keywords as needed.
git create-branch [branch_name]
Copy it and replace filenames, paths, or keywords as needed.
git diff-index HEAD
Copy it and replace filenames, paths, or keywords as needed.
git filter-branch --tree-filter 'rm -f [file]' HEAD
Copy it and replace filenames, paths, or keywords as needed.
git rebase -i HEAD~5
Copy it and replace filenames, paths, or keywords as needed.
git local-commits
Copy it and replace filenames, paths, or keywords as needed.
git ls-tree HEAD
Copy it and replace filenames, paths, or keywords as needed.
git ls-tree HEAD | git mktree
Uses pipes, overwrite, or deletion. Check paths and options first.
git mr [51]
Copy it and replace filenames, paths, or keywords as needed.
git reflog
Copy it and replace filenames, paths, or keywords as needed.
git request-pull [start] [url]
Copy it and replace filenames, paths, or keywords as needed.
git reset [file]
Copy it and replace filenames, paths, or keywords as needed.
git rev-list HEAD
Copy it and replace filenames, paths, or keywords as needed.
git rev-parse HEAD
Copy it and replace filenames, paths, or keywords as needed.
git sed "[old]" "[new]"
Copy it and replace filenames, paths, or keywords as needed.
git shortlog
Copy it and replace filenames, paths, or keywords as needed.
git show-unmerged-branches
Copy it and replace filenames, paths, or keywords as needed.
git squash [branch]
Copy it and replace filenames, paths, or keywords as needed.
git stash
Copy it and replace filenames, paths, or keywords as needed.
git symbolic-ref HEAD
Copy it and replace filenames, paths, or keywords as needed.
gtop
Copy it and replace filenames, paths, or keywords as needed.
gvpr -f [script.gvpr] [input.gv]
Copy it and replace filenames, paths, or keywords as needed.
head path/to/file
Copy it and replace filenames, paths, or keywords as needed.
hp-clean
Copy it and replace filenames, paths, or keywords as needed.
sudo iftop
May affect permissions or system state. Check the target first.
ii -s [irc.libera.chat] -n [nickname]
Copy it and replace filenames, paths, or keywords as needed.
jj tag list
Copy it and replace filenames, paths, or keywords as needed.
cat [data.json] | jq '.'
Uses pipes, overwrite, or deletion. Check paths and options first.
echo '{"name":"test"}' | jshon -e name
Uses pipes, overwrite, or deletion. Check paths and options first.
keep-header [file] -- sort
Copy it and replace filenames, paths, or keywords as needed.
keynav
Copy it and replace filenames, paths, or keywords as needed.
kubectl events
Copy it and replace filenames, paths, or keywords as needed.
kubectl logs [pod-name]
Copy it and replace filenames, paths, or keywords as needed.
kubetail [pod-name-prefix]
Copy it and replace filenames, paths, or keywords as needed.
lazyjournal
Copy it and replace filenames, paths, or keywords as needed.
less [file]
Copy it and replace filenames, paths, or keywords as needed.
tail -f [logfile] | logss -c "[pattern1]" -c "[pattern2]"
Uses pipes, overwrite, or deletion. Check paths and options first.
lstr
Copy it and replace filenames, paths, or keywords as needed.
lwp-request [https://example.com/]
Copy it and replace filenames, paths, or keywords as needed.
mcheck(NULL)
Copy it and replace filenames, paths, or keywords as needed.
mg [file.txt]
Copy it and replace filenames, paths, or keywords as needed.
mlr --csv --ojson cat [file.csv]
Copy it and replace filenames, paths, or keywords as needed.
mlr --csv --ojson cat [data.csv]
Copy it and replace filenames, paths, or keywords as needed.
msgfilter [sed -e 's/old/new/g'] < [input.po] > [output.po]
Uses pipes, overwrite, or deletion. Check paths and options first.
neoss
Copy it and replace filenames, paths, or keywords as needed.
nerdlog [user]@[host]
Copy it and replace filenames, paths, or keywords as needed.
netris
Copy it and replace filenames, paths, or keywords as needed.
nl [path/to/file]
Copy it and replace filenames, paths, or keywords as needed.
nomino -r "[regex]" "[output_pattern]"
Copy it and replace filenames, paths, or keywords as needed.
echo "[a b c]" | nth [2]
Uses pipes, overwrite, or deletion. Check paths and options first.
nu
Copy it and replace filenames, paths, or keywords as needed.
nu
Copy it and replace filenames, paths, or keywords as needed.
o [file]
Copy it and replace filenames, paths, or keywords as needed.
onefetch
Copy it and replace filenames, paths, or keywords as needed.
o [path/to/file]
Copy it and replace filenames, paths, or keywords as needed.
osmium extract -b [left],[bottom],[right],[top] [input.osm.pbf] -o [output.osm.pbf]
Copy it and replace filenames, paths, or keywords as needed.
parquet-tools schema [file.parquet]
Copy it and replace filenames, paths, or keywords as needed.
perl [script.pl]
Copy it and replace filenames, paths, or keywords as needed.
pico [path/to/file]
Copy it and replace filenames, paths, or keywords as needed.
pngquant --quality=[65-80] [image.png]
Copy it and replace filenames, paths, or keywords as needed.
pnmcolormap [256] [image.ppm] > [colormap.ppm]
Uses pipes, overwrite, or deletion. Check paths and options first.
pnmquant [256] [input.pnm] > [output.pnm]
Uses pipes, overwrite, or deletion. Check paths and options first.
pod2html --infile=[file.pod] --outfile=[file.html]
Copy it and replace filenames, paths, or keywords as needed.
poster -p [A0] -s [1.0] [input.ps] > [output.ps]
Uses pipes, overwrite, or deletion. Check paths and options first.
poweroff
Copy it and replace filenames, paths, or keywords as needed.
ppmglobe [strips] [input.ppm] [output]
Copy it and replace filenames, paths, or keywords as needed.
ppmquant [256] [input.ppm] > [output.ppm]
Uses pipes, overwrite, or deletion. Check paths and options first.
procmail < [email.txt]
Copy it and replace filenames, paths, or keywords as needed.
pueue follow [task_id]
Copy it and replace filenames, paths, or keywords as needed.
qsv count [data.csv]
Copy it and replace filenames, paths, or keywords as needed.
raku
Copy it and replace filenames, paths, or keywords as needed.
head -c 16 /dev/urandom
Copy it and replace filenames, paths, or keywords as needed.
sudo reflector --sort rate --save /etc/pacman.d/mirrorlist
May affect permissions or system state. Check the target first.
regex
Copy it and replace filenames, paths, or keywords as needed.
resolvconf -u
Copy it and replace filenames, paths, or keywords as needed.
rlog [file.c]
Copy it and replace filenames, paths, or keywords as needed.
rsstail -u [https://example.com/feed.rss]
Copy it and replace filenames, paths, or keywords as needed.
rubish
Copy it and replace filenames, paths, or keywords as needed.
ruby
Copy it and replace filenames, paths, or keywords as needed.
scheme
Copy it and replace filenames, paths, or keywords as needed.
sd '[find]' '[replace]' [path/to/file]
Copy it and replace filenames, paths, or keywords as needed.
[command] | sed 's/apple/mango/g'
Uses pipes, overwrite, or deletion. Check paths and options first.
python3 -m http.server
Copy it and replace filenames, paths, or keywords as needed.
sudo slabtop
May affect permissions or system state. Check the target first.
snake4
Copy it and replace filenames, paths, or keywords as needed.
sort [file]
Copy it and replace filenames, paths, or keywords as needed.
cat [file.txt] | sort | sponge [file.txt]
Uses pipes, overwrite, or deletion. Check paths and options first.
echo 'Hello World!' | srgn '[wW]orld' -- 'there'
Uses pipes, overwrite, or deletion. Check paths and options first.
stdbuf -oL [command]
Copy it and replace filenames, paths, or keywords as needed.
stern [pod-query]
Copy it and replace filenames, paths, or keywords as needed.
supervisorctl status
Copy it and replace filenames, paths, or keywords as needed.
sview
Copy it and replace filenames, paths, or keywords as needed.
tail [file]
Copy it and replace filenames, paths, or keywords as needed.
tailf
Copy it and replace filenames, paths, or keywords as needed.
tl [access.log]
Copy it and replace filenames, paths, or keywords as needed.
cat [file] | tqdm --bytes | wc -l
Uses pipes, overwrite, or deletion. Check paths and options first.
echo "hello" | tr 'a-z' 'A-Z'
Uses pipes, overwrite, or deletion. Check paths and options first.
transmission-remote -l
Copy it and replace filenames, paths, or keywords as needed.
tsort [dependencies.txt]
Copy it and replace filenames, paths, or keywords as needed.
tspin [logfile.log]
Copy it and replace filenames, paths, or keywords as needed.
echo "[a\tb\tc]" | tuc -f 1
Uses pipes, overwrite, or deletion. Check paths and options first.
echo "[straße]" | uc
Uses pipes, overwrite, or deletion. Check paths and options first.
ug "[pattern]" [file]
Copy it and replace filenames, paths, or keywords as needed.
sort [file] | uniq
Uses pipes, overwrite, or deletion. Check paths and options first.
echo "text" | vipe
Uses pipes, overwrite, or deletion. Check paths and options first.
wc [file]
Copy it and replace filenames, paths, or keywords as needed.
wisu
Copy it and replace filenames, paths, or keywords as needed.
xcv x [file1] [file2]
Copy it and replace filenames, paths, or keywords as needed.
xml depyx [file.pyx]
Copy it and replace filenames, paths, or keywords as needed.
xml pyx [file.xml]
Copy it and replace filenames, paths, or keywords as needed.
xml val [file.xml]
Copy it and replace filenames, paths, or keywords as needed.
xmlstarlet sel -t -v "[xpath]" [file.xml]
Copy it and replace filenames, paths, or keywords as needed.
yazi
Copy it and replace filenames, paths, or keywords as needed.
zeek -r [capture.pcap]
Copy it and replace filenames, paths, or keywords as needed.
zmv '(*)' '${(U)1}'
Copy it and replace filenames, paths, or keywords as needed.