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

Comments on Ergonomic way to search man pages

Post

Ergonomic way to search man pages

+1
−0

You often have to read man pages to use Linux/Unix software. However, many man pages are not easy to read. They are very long, not always conveniently arranged, and man does not appear to have any way to handle indices or sections. A great example is man rsync.

I am often in a situation where some popular tool has a LOOONG man page, and I just need to look up the one argument about a specific thing. I don't like having to read the whole thing just for one tiny part of it. It takes a long time, breaks my flow, and if I try to read it start to finish, I am usually very confused and overwhelmed by the time I get to the end. The default pager (I think less) lets me search with /, but it's not very user friendly and it's easy to end up with an too general or too specific search string.

I've been resorting to stuff like man rsync | rg -C 3 symlink, which is much nicer. However, this is still a bit too dumb sometimes. For example, man pacman | rg -C 3 owns does find the switch that tells you what package provides a file, but then you still have to dig through the man page to figure out that it's in the section of switches applicable to -S (which is much higher in the page so ripgrep's context switch doesn't help).

Man pages have been around for half a century. Surely in this time, someone has come out with a way to peruse them that's better than this?

PS: For other people, there are tools like https://tldr.sh/ and https://github.com/cheat/cheat that provide shorter, alternate manual pages. Unfortunately these don't work for my question because they are not comprehensive - they obviously omit many details of the man page, and also there is not always a tldr page for every man page.

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.
Why should this post be closed?

1 comment thread

What about the experience of searching within less do you find user-unfriendly? Less has a lot of pow... (4 comments)
What about the experience of searching within less do you find user-unfriendly? Less has a lot of pow...
r~~‭ wrote over 1 year ago

What about the experience of searching within less do you find user-unfriendly? Less has a lot of power user features that might be easier to learn than switching to a novel man page consumption model.

matthewsnyder‭ wrote over 1 year ago

Case sensitive search is annoying, no fuzzy search, a lot of complex hotkeys that are hard to remember...

matthewsnyder‭ wrote over 1 year ago

Ripgrep for example has a great way of handling cases. If query is all lower case, it does case insensitive. If it has upper case chars, it is case sensitive. You can also force case sensitive with a switch.

r~~‭ wrote over 1 year ago

Ripgrep for example has a great way of handling cases. If query is all lower case, it does case insensitive. If it has upper case chars, it is case sensitive. You can also force case sensitive with a switch.

Have you tried this in less? I see the exact same behavior. They even use the same flag to do the same thing: -i