9 ms·
I can just never get past the arg/flag inconsistency/complexity across commands. Perhaps if the docs started with a simple example of what has been seen over ti
by jancsika 6y ago
I can just never get past the arg/flag inconsistency/complexity across commands. Perhaps if the docs started with a simple example of what has been seen over time to be the most common incantation for each command it might be tolerable. But as it is, I spend more time dealing with idiosyncracies of a command than I do expressively piping stuff.
Perhaps if Rust had five mutually incompatible borrow-checkers which get called based on who wrote the code for a particular language construction-- that might get across the frustration I feel when using the shell. (Well, honestly I just StackOverflow for the shell incantation I need and that seems to work well enough.)
- rootlocus 6y ago> Perhaps if the docs started with a simple example of what has been seen over time to be the most common incantation for each command it might be tolerable. You might enjoy https://cheat.sh https://cheat.sh which is usable via curl: `curl cheat.sh/grep`
- regenetron 6y agoThanks for sharing, that’s a great tool.
- zeppelin101 6y agoVery impressive. I just made a function 'cheat' that takes a command name as input and curls this website. Thanks.
- acabal 6y agoThe inconsistency sometimes bothers me too, but it makes me feel a little better to remember that so many of the CLI commands we take for granted are part of an old historical heritage. The inconsistency is part of that heritage--today's CLI wasn't designed all at once by one group, but rather evolved over 50+ years from many contributors, back when nobody expected that people would still be using `sed` in 2020. For me, reflecting on that history helps dull the annoyance of having to type `grep --extended-regexp` but `sed --regexp-extended`.
- boogies 6y ago(nit) > `grep --extended-regexp` but `sed --regexp-extended` Why not use `grep -E` and `sed -E`?
- acabal 6y agoThat's what I do on the command line (though I went so far as to just alias `grep` to `grep -E`), but when writing scripts I prefer to use expanded flags for clarity. When going back to a script one wrote a year ago, it's way easier to grok expanded flags instead of a bunch of single letters that have to be re-deciphered. (Especially with something like `grep` or `sed` that have 1,000 flags each.)
- gnubison 6y ago> Especially with something like `grep` or `sed` that have 1,000 flags each. Sometimes I actually read the POSIX man pages instead of the standard ones — they are sometimes more useful because they have fewer features. Sometimes they are less useful because of their verbose language, though.
- boogies 6y ago> more useful because they have fewer features That’s probably why DuckDuckGo’s `!man man`/manpage.me default to FreeBSD manpages. But if you really want something non-verbose you may prefer tldr.sh, cht.sh, or bro pages.
- PaulDavisThe1st 6y agoHint: if you're still using grep to search files rather than a file, install and start using the "newer generation" of greps (ag, ripgrep etc). You likely won't believe the speed. I use ag many times a day to search 10,400 files comprising about 800k lines of code, and it is in every meaningful way completely instantaneous. It also understands repository structures, and so won't waste your time there. It seriously changed my (programming) life.
- vicek22 6y agoI recommend https://tldr.sh/ https://tldr.sh/. Since I installed `tldr`, I rarely read the man pages.
- rement 6y agotldr [0] is great for easy to understand example commands. It is community driven and there are many cli based programs you can install[1][2]. [0] https://tldr.sh/ https://tldr.sh/ [1] https://www.npmjs.com/package/tldr https://www.npmjs.com/package/tldr [2] https://github.com/tldr-pages/tldr-python-client https://github.com/tldr-pages/tldr-python-client
- fireattack 6y agoThat python client seems very lack of maintenance. It doesn't have proper color code for Windows at all.
- rement 6y agoThat's true. I thought that was the one packaged by most linux distros but debian packages the haskell client [0]. Looks like they have some windows builds too. [0] https://github.com/psibi/tldr-hs#readme https://github.com/psibi/tldr-hs#readme
- dafoex 6y agoUsing Fish as my shell somewhat makes this morn tolerable as it checks the manpages and automatically suggests flags in a tab-complete fashion. It also remembers previously run commands and suggests them, which helps with not having to remember exactly which flag does what, because the example comes from the last time you ran the command.
- vips7L 6y agoThis is why I use PowerShell. Menu completion gives me all of the switches with their full name instead of cryptic abbreviations.
- combatentropy 6y agoYou're right. I often think the man page should begin with a few examples, then launch into the neverending list of options. That is no way to learn. In foreign language 101, they start you off with a small group of examples. "Como estas?" "Muy bien. Y tu?" Afterward, they explain the rules of the language (this is a noun, this is a verb, this is how you conjugate for first-person singular, etc.). In fact, this is how we learn our first language as babies. Anyone remember Mom and Dad pulling out a flip chart? Or did they just talk to you a lot? The same goes with apprenticeships, I would think. The blacksmith starts the apprentice with simple tasks around the shop. I suppose he would intersperse it with the occasional pontification about principles and theory, but he would not sit down the pupil for weeks explaining everything before just letting him get his hands dirty. The Linux man pages are upside down. Examples don't come till the very end, if at all. Thankfully, like you said, there is now Stack Overflow.
- ddevault 6y ago>The Linux man pages are upside down. Examples don't come till the very end, if at all. You only learn the tool once. Every subsequent time you visit the man page, the information you're probably looking for is frontloaded. Just scroll to the bottom if you want examples?
- combatentropy 6y agoFair points. After all, I know the keyboard shortcut to jump to the bottom (Ctrl-G).
- teddyh 6y agoAccording to less(1), the key is: “G or > or ESC->”.
- combatentropy 6y agoSorry, I meant Shift-G. I can no longer edit that comment.
- ohthehugemanate 6y agoYou would probably love the tldr[1] command, then. It's a user maintained library of common example incantations of any given command. Nowadays I check it before `man`. [1] https://tldr.sh/ https://tldr.sh/
- Scarbutt 6y agoPerhaps if Rust had five mutually incompatible borrow-checkers which get called based on who wrote the code for a particular language construction-- that might get across the frustration I feel when using the shell. You mean like the five mutually incompatible async solutions in rust?
- jariel 6y agoThis is a really big deal. Almost nothing in computerdom was designed from a developer-centric perspective and it blows my mind. Maybe I'm 'opposite brained' but it's the first thing that I think about when making something, sometimes at the expensive of the algorithm. There's a bird in the back of my mind literally every time I use the shell chirping at me to translate them all into something consistent, and then make actually useful manpages for them. The world is complicated, we have too much to learn, communications and ramp-up are essential and part of the product even if there's genius under the hood. (I'm also looking at you Rust, Git).
- mannykannot 6y agoAt least when you go to Stack Overflow or read the man page, if you find an answer, then it is likely to work. In contrast, if you go to Stack Overflow to find out how to do something with a GUI program, there's a good chance that the answer you find is for a different version than you are working with, and does not help at all.
- saagarjha 6y agoDepends. Are you on macOS?
- mannykannot 6y agoWhat is your specific claim here?
- saagarjha 6y agomacOS tools generally do not match what Stack Overflow tells you.
- mannykannot 6y agoAh, yes - I have come across some differences in command-line flags and default behaviors between macOS and the nominally equivalent tools as implemented in Linux or specified by Posix, and sometimes, on Stack Overflow, you will find people answering Mac-specific questions on the Dunning-Krugeresque assumption that it is the same as the others. In general, one should always verify Stack Overflow answers before using, but that often gets you closer to the answer you need than one starting from a scenario that simply isn't available on your version of, say, Xcode. The same goes for systems derived from BSD - in fact, I wonder if some of the differences between MacOS and Linux comes from the former's origins in Mach/BSD via Nextstep.
- Wowfunhappy 6y ago> I wonder if some of the differences between MacOS and Linux comes from the former's origins in Mach/BSD via Nextstep. My understanding was that this is most of it. The problem is relatively basic—macOS uses the BSD versions of most unix tools, which means basic commands like sed sometimes function quite differently!
- deleted 6y ago[deleted]
- commandlinefan 6y agoIt’s even worse if you man test: you’re directed to the shell builtins page, that’s a few hundred pages long.
- BenjiWiebe 6y agoFor builtins, use help. 'help test'
- teflodollar 6y ago> Perhaps if the docs started with a simple example of what has been seen over time to be the most common incantation for each command it might be tolerable. Rsync’s man page opens with examples, and even though I never actually those specific commands, they are usually enough for me to remember how to do whatever I wanted to do.
- Aeolun 6y agoYou might want to look into the ‘tldr’ command for those simple shell examples. It’s a very helpful command.
- dehrmann 6y agoIt's even worse when you bounce between Linux, FreeBSD, and MacOS.
- IndexPointer 6y agoLookup tldr on github. It works as a replacement for man pages 90% of the time.