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
需要网络或远程资源。
du -h . | sort -hr | head -20
涉及管道、覆盖或删除,执行前请先确认路径和参数。
du -sh * | sort -hr
涉及管道、覆盖或删除,执行前请先确认路径和参数。
< /dev/urandom tr -dc A-Za-z0-9 | head -c 32; echo
涉及管道、覆盖或删除,执行前请先确认路径和参数。
wc -l file.txt
复制后可按需替换文件名、目录或参数。
sort file | uniq
涉及管道、覆盖或删除,执行前请先确认路径和参数。
tail -f logfile
复制后可按需替换文件名、目录或参数。
sed -i 's/old/new/g' *.txt
复制后可按需替换文件名、目录或参数。
nl file.txt
复制后可按需替换文件名、目录或参数。
command | pv -s $(du -b input | cut -f1)
涉及管道、覆盖或删除,执行前请先确认路径和参数。
ls | wc -l
涉及管道、覆盖或删除,执行前请先确认路径和参数。
history | awk '{print $2}' | sort | uniq -c | sort -nr | head
涉及管道、覆盖或删除,执行前请先确认路径和参数。
a2p [script.awk] > [script.pl]
涉及管道、覆盖或删除,执行前请先确认路径和参数。
apt-sortpkgs [Packages] > [Packages.sorted]
涉及管道、覆盖或删除,执行前请先确认路径和参数。
atac
复制后可按需替换文件名、目录或参数。
awk '{print $5}' [path/to/file]
复制后可按需替换文件名、目录或参数。
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
复制后可按需替换文件名、目录或参数。
basalt
复制后可按需替换文件名、目录或参数。
battlestar
复制后可按需替换文件名、目录或参数。
bgpgrep [path/to/rib.mrt.gz] -subnet [192.0.2.0/24]
权限或系统影响较大,执行前请核对目标。
echo "one two three" | choose 0
涉及管道、覆盖或删除,执行前请先确认路径和参数。
cointop
复制后可按需替换文件名、目录或参数。
combine [file1] and [file2]
复制后可按需替换文件名、目录或参数。
coreutils --help
复制后可按需替换文件名、目录或参数。
csv2tsv [input.csv] > [output.tsv]
涉及管道、覆盖或删除,执行前请先确认路径和参数。
csvcut -c [1,3,5] [data.csv]
复制后可按需替换文件名、目录或参数。
csvlook [data.csv]
复制后可按需替换文件名、目录或参数。
ctop -a
复制后可按需替换文件名、目录或参数。
cut -f [1,3] [file.txt]
复制后可按需替换文件名、目录或参数。
pip install deflect-one
复制后可按需替换文件名、目录或参数。
docker container logs [container]
复制后可按需替换文件名、目录或参数。
dolt checkout [branch_name]
复制后可按需替换文件名、目录或参数。
du -sh [directory]
复制后可按需替换文件名、目录或参数。
dvc diff
复制后可按需替换文件名、目录或参数。
ed [file.txt]
复制后可按需替换文件名、目录或参数。
gawk '{print $1, $3}' [path/to/file]
复制后可按需替换文件名、目录或参数。
head -c [16] /dev/urandom | xxd
涉及管道、覆盖或删除,执行前请先确认路径和参数。
git abort
复制后可按需替换文件名、目录或参数。
git archive-file
复制后可按需替换文件名、目录或参数。
git archive HEAD -o [archive.tar]
复制后可按需替换文件名、目录或参数。
git checkout-index -a
复制后可按需替换文件名、目录或参数。
git checkout [branch-name]
复制后可按需替换文件名、目录或参数。
git clear-soft
复制后可按需替换文件名、目录或参数。
git clear
复制后可按需替换文件名、目录或参数。
git create-branch [branch_name]
复制后可按需替换文件名、目录或参数。
git diff-index HEAD
复制后可按需替换文件名、目录或参数。
git filter-branch --tree-filter 'rm -f [file]' HEAD
复制后可按需替换文件名、目录或参数。
git rebase -i HEAD~5
复制后可按需替换文件名、目录或参数。
git local-commits
复制后可按需替换文件名、目录或参数。
git ls-tree HEAD
复制后可按需替换文件名、目录或参数。
git ls-tree HEAD | git mktree
涉及管道、覆盖或删除,执行前请先确认路径和参数。
git mr [51]
复制后可按需替换文件名、目录或参数。
git reflog
复制后可按需替换文件名、目录或参数。
git request-pull [start] [url]
复制后可按需替换文件名、目录或参数。
git reset [file]
复制后可按需替换文件名、目录或参数。
git rev-list HEAD
复制后可按需替换文件名、目录或参数。
git rev-parse HEAD
复制后可按需替换文件名、目录或参数。
git sed "[old]" "[new]"
复制后可按需替换文件名、目录或参数。
git shortlog
复制后可按需替换文件名、目录或参数。
git show-unmerged-branches
复制后可按需替换文件名、目录或参数。
git squash [branch]
复制后可按需替换文件名、目录或参数。
git stash
复制后可按需替换文件名、目录或参数。
git symbolic-ref HEAD
复制后可按需替换文件名、目录或参数。
gtop
复制后可按需替换文件名、目录或参数。
gvpr -f [script.gvpr] [input.gv]
复制后可按需替换文件名、目录或参数。
head path/to/file
复制后可按需替换文件名、目录或参数。
hp-clean
复制后可按需替换文件名、目录或参数。
sudo iftop
权限或系统影响较大,执行前请核对目标。
ii -s [irc.libera.chat] -n [nickname]
复制后可按需替换文件名、目录或参数。
jj tag list
复制后可按需替换文件名、目录或参数。
cat [data.json] | jq '.'
涉及管道、覆盖或删除,执行前请先确认路径和参数。
echo '{"name":"test"}' | jshon -e name
涉及管道、覆盖或删除,执行前请先确认路径和参数。
keep-header [file] -- sort
复制后可按需替换文件名、目录或参数。
keynav
复制后可按需替换文件名、目录或参数。
kubectl events
复制后可按需替换文件名、目录或参数。
kubectl logs [pod-name]
复制后可按需替换文件名、目录或参数。
kubetail [pod-name-prefix]
复制后可按需替换文件名、目录或参数。
lazyjournal
复制后可按需替换文件名、目录或参数。
less [file]
复制后可按需替换文件名、目录或参数。
tail -f [logfile] | logss -c "[pattern1]" -c "[pattern2]"
涉及管道、覆盖或删除,执行前请先确认路径和参数。
lstr
复制后可按需替换文件名、目录或参数。
lwp-request [https://example.com/]
复制后可按需替换文件名、目录或参数。
mcheck(NULL)
复制后可按需替换文件名、目录或参数。
mg [file.txt]
复制后可按需替换文件名、目录或参数。
mlr --csv --ojson cat [file.csv]
复制后可按需替换文件名、目录或参数。
mlr --csv --ojson cat [data.csv]
复制后可按需替换文件名、目录或参数。
msgfilter [sed -e 's/old/new/g'] < [input.po] > [output.po]
涉及管道、覆盖或删除,执行前请先确认路径和参数。
neoss
复制后可按需替换文件名、目录或参数。
nerdlog [user]@[host]
复制后可按需替换文件名、目录或参数。
netris
复制后可按需替换文件名、目录或参数。
nl [path/to/file]
复制后可按需替换文件名、目录或参数。
nomino -r "[regex]" "[output_pattern]"
复制后可按需替换文件名、目录或参数。
echo "[a b c]" | nth [2]
涉及管道、覆盖或删除,执行前请先确认路径和参数。
nu
复制后可按需替换文件名、目录或参数。
nu
复制后可按需替换文件名、目录或参数。
o [file]
复制后可按需替换文件名、目录或参数。
onefetch
复制后可按需替换文件名、目录或参数。
o [path/to/file]
复制后可按需替换文件名、目录或参数。
osmium extract -b [left],[bottom],[right],[top] [input.osm.pbf] -o [output.osm.pbf]
复制后可按需替换文件名、目录或参数。
parquet-tools schema [file.parquet]
复制后可按需替换文件名、目录或参数。
perl [script.pl]
复制后可按需替换文件名、目录或参数。
pico [path/to/file]
复制后可按需替换文件名、目录或参数。
pngquant --quality=[65-80] [image.png]
复制后可按需替换文件名、目录或参数。
pnmcolormap [256] [image.ppm] > [colormap.ppm]
涉及管道、覆盖或删除,执行前请先确认路径和参数。
pnmquant [256] [input.pnm] > [output.pnm]
涉及管道、覆盖或删除,执行前请先确认路径和参数。
pod2html --infile=[file.pod] --outfile=[file.html]
复制后可按需替换文件名、目录或参数。
poster -p [A0] -s [1.0] [input.ps] > [output.ps]
涉及管道、覆盖或删除,执行前请先确认路径和参数。
poweroff
复制后可按需替换文件名、目录或参数。
ppmglobe [strips] [input.ppm] [output]
复制后可按需替换文件名、目录或参数。
ppmquant [256] [input.ppm] > [output.ppm]
涉及管道、覆盖或删除,执行前请先确认路径和参数。
procmail < [email.txt]
复制后可按需替换文件名、目录或参数。
pueue follow [task_id]
复制后可按需替换文件名、目录或参数。
qsv count [data.csv]
复制后可按需替换文件名、目录或参数。
raku
复制后可按需替换文件名、目录或参数。
head -c 16 /dev/urandom
复制后可按需替换文件名、目录或参数。
sudo reflector --sort rate --save /etc/pacman.d/mirrorlist
权限或系统影响较大,执行前请核对目标。
regex
复制后可按需替换文件名、目录或参数。
resolvconf -u
复制后可按需替换文件名、目录或参数。
rlog [file.c]
复制后可按需替换文件名、目录或参数。
rsstail -u [https://example.com/feed.rss]
复制后可按需替换文件名、目录或参数。
rubish
复制后可按需替换文件名、目录或参数。
ruby
复制后可按需替换文件名、目录或参数。
scheme
复制后可按需替换文件名、目录或参数。
sd '[find]' '[replace]' [path/to/file]
复制后可按需替换文件名、目录或参数。
[command] | sed 's/apple/mango/g'
涉及管道、覆盖或删除,执行前请先确认路径和参数。
python3 -m http.server
复制后可按需替换文件名、目录或参数。
sudo slabtop
权限或系统影响较大,执行前请核对目标。
snake4
复制后可按需替换文件名、目录或参数。
sort [file]
复制后可按需替换文件名、目录或参数。
cat [file.txt] | sort | sponge [file.txt]
涉及管道、覆盖或删除,执行前请先确认路径和参数。
echo 'Hello World!' | srgn '[wW]orld' -- 'there'
涉及管道、覆盖或删除,执行前请先确认路径和参数。
stdbuf -oL [command]
复制后可按需替换文件名、目录或参数。
stern [pod-query]
复制后可按需替换文件名、目录或参数。
supervisorctl status
复制后可按需替换文件名、目录或参数。
sview
复制后可按需替换文件名、目录或参数。
tail [file]
复制后可按需替换文件名、目录或参数。
tailf
复制后可按需替换文件名、目录或参数。
tl [access.log]
复制后可按需替换文件名、目录或参数。
cat [file] | tqdm --bytes | wc -l
涉及管道、覆盖或删除,执行前请先确认路径和参数。
echo "hello" | tr 'a-z' 'A-Z'
涉及管道、覆盖或删除,执行前请先确认路径和参数。
transmission-remote -l
复制后可按需替换文件名、目录或参数。
tsort [dependencies.txt]
复制后可按需替换文件名、目录或参数。
tspin [logfile.log]
复制后可按需替换文件名、目录或参数。
echo "[a\tb\tc]" | tuc -f 1
涉及管道、覆盖或删除,执行前请先确认路径和参数。
echo "[straße]" | uc
涉及管道、覆盖或删除,执行前请先确认路径和参数。
ug "[pattern]" [file]
复制后可按需替换文件名、目录或参数。
sort [file] | uniq
涉及管道、覆盖或删除,执行前请先确认路径和参数。
echo "text" | vipe
涉及管道、覆盖或删除,执行前请先确认路径和参数。
wc [file]
复制后可按需替换文件名、目录或参数。
wisu
复制后可按需替换文件名、目录或参数。
xcv x [file1] [file2]
复制后可按需替换文件名、目录或参数。
xml depyx [file.pyx]
复制后可按需替换文件名、目录或参数。
xml pyx [file.xml]
复制后可按需替换文件名、目录或参数。
xml val [file.xml]
复制后可按需替换文件名、目录或参数。
xmlstarlet sel -t -v "[xpath]" [file.xml]
复制后可按需替换文件名、目录或参数。
yazi
复制后可按需替换文件名、目录或参数。
zeek -r [capture.pcap]
复制后可按需替换文件名、目录或参数。
zmv '(*)' '${(U)1}'
复制后可按需替换文件名、目录或参数。