Live data from Hacker News

Become Shell Literate

drewdevault.com

211–220 of 341 posts

Re: Become Shell Literate

#211

Earlier quoted context omitted.

You'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 ho…

>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?

> 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?

This is false for most tools we don't use daily. It's false even for tools we do use daily, in some cases (I have to google git commands every month or so for commands I use rarely).

Most people are and remain perpetual intermediates: https://blog.codinghorror.com/defending-perpetual-intermedia...

The experts are the exception.

Re: Become Shell Literate

#212
post #209

Shell is simultaneously wonderful and horrendous. Did you know that the left bracket ([) is actually not a part of bash syntax, but instead a binary that lives in /bin? Run “which [“ if you don’t believe me!

And other things which you'd expect to be commands are both commands AND builtins! And they behave differently depending on which you call! Some examples are time and pwd.

Re: Become Shell Literate

#213

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…

At 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.

Re: Become Shell Literate

#215
post #210

Earlier quoted context omitted.

Fair points. After all, I know the keyboard shortcut to jump to the bottom (Ctrl-G).

According to less(1), the key is: “G or > or ESC->”.

Sorry, I meant Shift-G. I can no longer edit that comment.

Re: Become Shell Literate

#217

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…

> 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 which is usable via curl: `curl cheat.sh/grep`

Thanks for sharing, that’s a great tool.

Re: Become Shell Literate

#218
post #35

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…

tldr [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/ [1] https://www.npmjs.com/package/tldr [2] https://github.com/tldr-pages/tldr-python-client

That python client seems very lack of maintenance. It doesn't have proper color code for Windows at all.

Re: Become Shell Literate

#219

Earlier quoted context omitted.

That would pose problems also. The real solution, with no need to magic as you say, is to disallow spaces at the filesystem level (just like slashes and the null character are forbidden). For users typing filenames, this shouldn't be a problem, as those can be encoded e.g., as unicode's non-breaking space. Using space as a separator is a very important power, that other programming languages share. In what other prog…

This would require filenames became valid utf-8. This would be a good thing to do nowadays, irritatingly (having tried handling Unix filenames as utf 8 in the past), surprisingly many users have non-utf8 filenames.

> This would require filenames became valid utf-8.

No, it wouldn't; you'd just get EINVAL if you pass a filename containing "\x20" to open or other syscalls. If a application wants to use "\xC2\xA0" in a filename, it can do that, or it can not do that, same as currently. Same applies if it wants to use, say, "\xAA\xFF".

Re: Become Shell Literate

#220
post #202

Nice post, but 2020 and still using an unauthenticated connection (plain netcat) to transfer data including executables (if I understood correctly) is not something you can justify when there are plenty of safe alternatives (e.g. wormhole, syncthing). Maybe the recipient and the sender just compare hashes via a secure channel, but there's no mention of this.

[deleted]
Post reply on HN