how.wtf

Great alternatives to man pages everyone needs

· Thomas Taylor

man (manual documentation pages) cannot be replaced; however, there are modern CLI tools that provide simplified experiences.

tldr pages

tldr is a community-curated collection of simplified man pages. As the name (too long; didn’t read) implies, the focus is providing straightforward examples that demonstrate tool usage.

Installing tldr

On MacOS,

1brew install tldr

Using the NodeJS client,

1npm -g tldr

Using the Python client,

1pip3 install tldr

Using `tldr

Using tldr is straightforward:

1tldr <some command name>
 1$ tldr tldr
 2
 3tldr
 4
 5Display simple help pages for command-line tools from the tldr-pages project.
 6More information: <https://tldr.sh>.
 7
 8- Print the tldr page for a specific command (hint: this is how you got here!):
 9    tldr command
10
11- Print the tldr page for a specific subcommand:
12    tldr command-subcommand
13
14- Print the tldr page for a command for a specific [p]latform:
15    tldr -p android|linux|osx|sunos|windows command
16
17- [u]pdate the local cache of tldr pages:
18    tldr -u

cheat

cheat is a tool used exclusively for supplying command usage. The intention is to provide a “cheatsheet” for *nix system administrators to quickly view command usage and contribute their own.

Installing cheat

On MacOS,

1brew install cheat

Using GO,

1go install github.com/cheat/cheat/cmd/cheat@latest

To find more installation examples, visit the document here.

Using cheat

Using cheat is simple:

1cheat <some command name>
 1$ cheat jq
 2# To pretty print the json:
 3jq "." < filename.json
 4
 5# To access the value at key "foo":
 6jq '.foo'
 7
 8# To access first list item:
 9jq '.[0]'
10
11# to slice and dice:
12jq '.[2:4]'
13jq '.[:3]'
14jq '.[-2:]'
15
16# to extract all keys from json:
17jq keys
18
19# to sort by a key:
20jq '.foo | sort_by(.bar)'
21
22# to count elements:
23jq '.foo | length'
24
25# print only selected fields:
26jq '.foo[] | {field_1,field_2}'
27
28# print selected fields as text instead of json:
29jq '.foo[] | {field_1,field_2} | join(" ")'
30
31# only print records where given field matches a value
32jq '.foo[] | select(.field_1 == "value_1")'

#Linux  

Reply to this post by email ↪