Master Command‑Line Cheat Sheets: tldr, cheat, and cht.sh Explained
This guide shows how to quickly test API response times with curl, explains the limitations of traditional man pages, and introduces lightweight cheat‑sheet tools—tldr, cheat, and cht.sh—including installation commands, practical usage examples for curl, tar, Python, and links to their repositories.
Measuring HTTP request latency with curl
Use a shell loop to invoke curl with -w to output timing metrics. Example for Bash/Zsh:
for i in {1..10}; do
curl -o /dev/null -s -w "$i | namelookup:%{time_namelookup} | connect:%{time_connect} | starttransfer:%{time_starttransfer} | total:%{time_total}
" http://httpbin.org/ip
doneThe output shows per‑run values for time_namelookup, time_connect, time_starttransfer, and time_total, which can be used to benchmark API response latency.
TL;DR simplified manual pages
Install the tldr client globally with npm: npm install -g tldr After installation, retrieve concise examples for any command:
tldr curl
tldr tar
tldr git checkoutTypical tar examples:
tar -cf target.tar file1 file2 file3 # create archive
tar -czf target.tar.gz file1 file2 file3 # create gzipped archive
tar -xf source.tar -C directory # extract to directoryTypical curl examples:
# download a file
curl -O http://example.com/file
# follow redirects and resume
curl -O -L -C - http://example.com/file
# send JSON payload
curl -d '{"name":"bob"}' -H 'Content-Type: application/json' http://example.com/apiSource code and community pages are hosted at https://github.com/tldr-pages/tldr .
cheat – extensible cheat‑sheet manager
Install with pip: pip install cheat Key commands: cheat <command> – show examples for a program cheat -e <command> – edit a cheatsheet cheat -l – list available cheatsheets cheat -s <command> – search cheatsheets
Example for curl (excerpt):
# download a single file
curl http://example.com/file
# download with custom filename
curl http://example.com/file.zip -o new_file.zip
# download multiple files
curl -O URL1 -O URL2
# resume a failed download
curl -C - -o partial.zip http://example.com/file.zip
# fetch only HTTP headers
curl -I http://example.com
# get external IP as JSON
curl http://ifconfig.me/all/jsonProject repository: https://github.com/cheat/cheat .
cht.sh – instant online cheat sheets
Query cheat sheets without installing any tool by sending an HTTP request to the service:
curl cht.sh/curl
curl cht.sh/tar
curl cht.sh/python/requestsThe response contains the same concise examples shown by tldr and cheat. The web interface is available at https://tldr.sh/ .
Additional command‑line resources
For Windows users, the cmder console and the Microsoft Terminal ( https://github.com/microsoft/Terminal ) provide an enhanced terminal experience.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
