329 points · by royalharsh95 · 7y ago · 52 comments
This has baffled me for years. I'd have guessed that discoverability and documentation would be a core functionality and focus of open source developers.
Also, if I find a command which flag is not explained by explain shell, is there some source I can create PR to? Some DB, where I could propose the addition..?
That said good documentation is a hard problem, what to document, how to do it, and what use it will have down the line. Your goal is not everyone elses goal, I always come to the problem from the other side: "I need this extra thing from this command, do I need to code somehting custom or is there something that can do it for me". So it's mostly a question of refrasing problems that fit the tools I have rather than looking up what one option does.
https://news.ycombinator.com/item?id=15776153
> $ apropos -s 3 Va=optind -a Va=optarg > https://man.openbsd.org/whatis.1
Then you only get the line with "bar" in it. (append -C 1 at the end to get 1 line before and 1 after the term you grepped for).
And of course you can pimp your terminal experience by using fish (https://fishshell.com/) as it ships with autosuggestions and other really nice features. (Beware that it will not provide 100% POSIX compliance but if that's an issue you can use ZSH or pimp your bash as well).
Then there is other kind of man pages like TLDR (https://github.com/tldr-pages/tldr) which is curated by community and quite awesome ;-)
I prefer to search from within the pager to see the option description in context:
man httpd
/-n
Then 'n' for the next hit or 'N' for the previous, like vi. This is for 'less' in general, not just man.> If a story has had significant attention in the last year or so, we kill reposts as duplicates. If not, a small number of reposts is ok.
I was embarrassed it's in there and expected a definitive rule. Now I'm not feeling that bad ;)
I know comment moderation sucks, but it would be great to have some kind of wiki/comment system/human generated notes on popular commands.
The difference is - from what I can deduce - that if it were to only call itself, there would be up to 2 `:` processes running at a time, while the bash call stack would grow indefinitely. Using all your RAM but not an actual fork bomb.
Adding the pipe makes the number of `:` processes grow exponentially, and very quickly you reach the limit of 16384 active processes (PIDs, actually) on a Linux box.
Also, that does sound great.
bomb() { bomb | bomb & }; bombThis is really well done, what a neat resource.
Everything you could ever ask for is in the manual and also in the man page.
RTFM: https://www.gnu.org/software/bash/manual/bash.html
If you need a tutorial or a guide then try this one: http://mywiki.wooledge.org/FullBashGuide