News for hackers. Stuff that matters.
Re:Making Hard Things Easy by thwarted on Friday October 06, 2023 @11:13AM (#37791861)
I tended to forget the order of the arguments of the find command, and I would lose time trying to remember its syntax when I'm in front of a machine with no readily available internet connection.

The man pages are readily available.

The bash man page is huge and hairy, but comprehensive, I've found it pretty valuable to be familiar with the major sections and the visual shape of the text in the man page so I can page through it quickly to locate the exact info I need. This is often faster than using a Internet search engine.

Re:Making Hard Things Easy by zvmaz on Friday October 06, 2023 @11:16AM (#37791916)
> The man pages are readily available.

True, but I find the man pages not easy and quick to parse.

Re:Making Hard Things Easy by imp0cat on Friday October 06, 2023 @11:34AM (#37792168)
Right. I don't think you're supposed to read them top-to-bottom.

Use `/` and search for the things of interest (keywords, arguments, options, etc...). Use n/N to quickly jump forward/back.

Re:Making Hard Things Easy by lazide on Friday October 06, 2023 @03:49PM (#37795389)
Find has a particularly bad man page to find things that way.
Re:Making Hard Things Easy by tripleo1 on Friday October 06, 2023 @04:32PM (#37795994)
FWIW it's `-maxdepth 1` not `-depth 1`.

But yeah, you're right.

Re:Making Hard Things Easy by lazide on Friday October 06, 2023 @10:42PM (#37798576)
Dude, flashbacks. Aren’t you supposed to do a trigger warning or something first! ;)
Re:Making Hard Things Easy by imp0cat on Friday October 06, 2023 @06:18PM (#37797071)
AFAIK there is a find replacement with sane defaults: https://github.com/sharkdp/fd , a lot of people I know love it.

However, I already have this in my muscle memory: find <where> -name '<what>' -type f(file)/d(directory)

Works in 90% of situations when searching for some file in terminal, ie: find / -name 'stuff*'

The rest of the time is spent figuring out exec/xargs. :)

And once you master that, swap xargs for GNU parallel. I bet your machine has a ton of cores, don't let then sit idly. ;)

Re:Making Hard Things Easy by anjanb on Saturday October 07, 2023 @02:14PM (#37804127)
you can grep the man page contents by using the following command

man <command> | col -b | grep "search_string"

Re:Making Hard Things Easy by pixelbyindex on Friday October 06, 2023 @12:06PM (#37792579)
I'm not a fan of man pages. Or any documentation that focuses on textual explanations rather than examples in code (looking at you aws).

I recently found https://tldr.sh/ and found it more convenient. I ended up writing myself a vscode extension to have a quick lookup at my fingertips, since I am at least 60% of the time looking at a terminal in vscode

Re:Making Hard Things Easy by anjanb on Saturday October 07, 2023 @01:32PM (#37803686)
I've used a small bash function. example : to search grep's manual for "lines", I type gm grep "lines"

gm () { man $1 | col -b | grep --color=always "$2" }

I also have something similar for grepping a command's help

gh () { $1 --help | grep --color=always $2 }

I usually try gh(grep help) and if I don't get what I'm looking for, I run gm(grep man).

It appears that I can also use tldr

Re:Making Hard Things Easy by layer8 on Friday October 06, 2023 @12:10PM (#37792626)
For find, I think the Info pages are (even) more comprehensive (info find), and you get more structural navigation.
Re:Making Hard Things Easy by eviks on Friday October 06, 2023 @12:36PM (#37792978)
Comprehensiveness is not a benefit if it's poorly searchable