Command Line Interface
Text-based interface.
Notes
Commonly forgot tricks
>for override,>>for appendecho $PATH | tr ':' '\n'- Echo all path per line
Network related
curl -d '{"key":"value"}' https://domain.com/path/to/file- POST request
Resources
- The Linux Command Line for Beginners | Ubuntu
- If you don't know what are
cd,ls, andgrep, this might be where to start - Ultimately, learn by trial and error
- If you don't know what are
- Command Line Interface Guidelines
- A guide to building command line interfaces, very detailed and informative
- The philosophy of a good CLI and the guidelines to follow when building one
- The terminal | furbo.org
- A long list of commands in Unix and Mac
Sites
- Modern Unix
- A collection of modern alternatives for some classic Unix commands
- Explain Shell
- Visually breaking down and explaining a shell command
- tldr.sh
- Simplified and community-driven manual
Links
- What is the SSH randomart image for?
- There is a "randomart image" from
ssh-keygenfrom the terminal - Support comparing host keys visually, especially recognizing host keys that have been changed
- There is a "randomart image" from
- CLI tools in the Python standard library | Simon Willison
(HN)
- Server current directory over HTTP:
python -m http.server 8000 - Pretty-print JSON:
echo '{"key": "value"}' | python -m json.tool tokenize,base64,random,calendar, etc.
- Server current directory over HTTP:
- What does
2>/dev/nullmeans?>means redirect,2> filemeans redirectstderrto file,/dev/nullis the null device
- Entering text in the terminal is complicated | Julia Evans
(HN)
- The baseline:
- No arrows, no history
Ctrl+Wdelete word,Ctrl+Udelete linestty -alist what's supported in the terminal
readline:- Up arrow to previous command
Ctrl+EorEnd,Ctrl+AorHome,Ctrl+left/rightback/forward 1 wordCtrl+Rto search historyrlwrap pythonto wrap a program with readline support
- The baseline:
- Terminal Colours are Tricky | Julia Evans
- 16 ANSI colours, configuring colours, problem of colours in vim, etc.
- "Rules" that terminal programs follow | Julia Evans
(HN)
- Ctrl-C, Ctrl-D, Ctrl-W, 16 ANSI colors,
-for stdin/stdout
- Ctrl-C, Ctrl-D, Ctrl-W, 16 ANSI colors,
- What does "2>&1" mean?
2refers to file descriptor 1 (stdout) and 2 (stderr) redirect (>) to&1file descriptor 1 (stdout)