Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Post History

60%
+1 −0
Q&A How to RTFM well to get a CLI command

The existing answer is good, but I'll add a short version. man FOO is the most reliable way. A large majority of programs have a man page, and a large majority of man pages cover all aspects of ...

posted 11mo ago by matthewsnyder‭

Answer
#1: Initial revision by user avatar matthewsnyder‭ · 2023-12-17T18:21:41Z (11 months ago)
The existing answer is good, but I'll add a short version.

1. `man FOO` is the most reliable way. A large majority of programs have a man page, and a large majority of man pages cover all aspects of the program (assuming you have the patience to read it).
    * By default, most Linuxes will open the man page in `less`.
    * There are ways to colorize man pages to make them more readable. This should be a separate question.
    * A useful trick is to pipe into grep: `man ls | grep -C 3 date`
    * See also: https://linux.codidact.com/posts/289489
2. `tldr FOO` is a much shorter, third party, community managed summary of how to use a command. There are even more commands without a tldr page than without a man page, however most things have a tldr page. There are some competitors like bropages, cheat pages, etc. but usually tldr has the superset of information.
3. Installing a good shell completion tool is very helpful. For example, `fish` shell by default can tab-complete many commands, with not just a list of possible arguments but also their descriptions. Other shells have plugins with similar functions.
4. It is common courtesy for CLI programs to support either a `-h` or `--help` argument. You can pipe this into grep as well if long.
5. These days it is useful to search online for a program's git repo, and read the readme and/or repo wiki since developers like to start documenting there.
6. The [Arch wiki](https://wiki.archlinux.org/) and [Gentoo wiki](https://wiki.gentoo.org/) are currently great go-to resources for individual programs. They don't have all programs but they have most. If you are not using Arch/Gentoo you may need to adapt some instructions.