Live data from Hacker News

Unix command line conventions over time

blog.liw.fi

101–110 of 222 posts

Re: Unix command line conventions over time

#101
post #89

Earlier quoted context omitted.

I don't think remembering rm is the issue. It's remembering all the options in all their variations. Take the ps command. I tend to use it as "ps aux" - but I have no idea what the a, the u, or the x stand for individually. I know other people who use "ps -ef". (Also note the difference : the aux doesn't require a dash, and if you accidentally put it in, it doesn't do what you want it to do.) As another example : the…

My favorite example: `cp -r` is recursive. `scp -r` is recursive. `chmod -r` removes read permissions; `chmod -R` is recursive.

I have done chmod -r plenty times by mistake and never known it removed read permissions. Oh God.

Re: Unix command line conventions over time

#102

I was at Bell during the options “debate.” I think something that this otherwise wonderful article misses is that some believed that commands were never intended to be the only way to use the system as the shell was intended to be just one of the many user interfaces that Research Unix would provide. From that perspective, it was entirely reasonable to believe that if a command was so complex that it needed options t…

>From that perspective, it was entirely reasonable to believe that if a command was so complex that it needed options than it was likely more appropriate for one of the other user interfaces What would the non-shell interface to commands for text processing pipelining (e.g. sort, cut, grep, etc., all of which absolutely need options to function) have looked like? Some people to this day believe that any text processi…

> six lines of McIlroy’s shell pipeline accomplished the same thing as

Common misconception. See https://buttondown.email/hillelwayne/archive/donald-knuth-wa... ("Donald Knuth Was Framed") and discussion at https://news.ycombinator.com/item?id=22406070 (etc).

Re: Unix command line conventions over time

#103
post #82

Earlier quoted context omitted.

I suspect GCC thinks of its options as mainly single-option short options and double-hyphen long options. It's reasonable to interpret things like `-funsafe-math-optimizations` to mean option `-f` with argument `unsafe-math-optimizations`, just like how `-Dfoo` means option `-D` with argument `foo`. Unless you were thinking about something else.

Just go through the docs. They have a ton of single hyphen long opts that aren't a letter with argument.

Huh, you're right. I had never noticed options like `-gen-decls` or `-nostdinc` before. I also should've thought of `-static`. Yeah, that's weird.

Also, I just noticed: they have `-nostdinc` for C, but the C++ equivalent is `-nostdinc++`, which looks like "no stdin C++".

Re: Unix command line conventions over time

#104

And then you have ImageMagick where the order of flags and options is a science by itself.

Well magick is more a single live scripting language with multiple paths. While it works, I think it’s the wrong tool for the job

So you are saying Imagemagick is the wrong tool for any job then? (I ask this because the OP didn't reference any particular task). I would disagree with that. Like many media-related command line tools, it does a lot and therefore has a fairly involved command line interface, but I have found it very useful over the years for processing multiple images (and sometimes even just individual ones).

Re: Unix command line conventions over time

#105
post #84
post #58

Earlier quoted context omitted.

Also ps. Everyone uses their own incantation and never strays from it. I use `ps aux` and used to use `ps -def` on Solaris. Some options require a dash, some don’t, it’s such a confusing CLI I never bothered to learn more. EDIT: also why is `ps` default output so useless? With no arguments it only prints a couple processes and that's it. I have no idea what it's supposed to show me. Talk about bad UX.

In case you're curious, the differences basically stem from BSD and Solaris/POSIX having different command syntaxes, and GNU/Linux's ps command trying to implement both. `ps -ef` is the Solaris syntax, while `ps aux` is from BSD.

Almost. `ps ax` was original Unix form (BSD did add `u`, and later accepted `-` on the flags). `ps -ef` was AT&T System III and descendants.

Re: Unix command line conventions over time

#106

Earlier quoted context omitted.

The syntax is common to most JCL ("job control language") commands. I'd say "all", though there are probably exceptions. For some reason, this seems to be vanishingly scarce knowledge in Linux / Unix circles. There was a time in my life I knew how to spell JCL....

For some reason, this seems to be vanishingly scarce knowledge in Linux / Unix circles. There was someone on HN a couple of weeks ago who was astounded to learn that "modem" means "modulator-demodulator." Like it was some kind of forbidden magic. Things that you an I consider entry-level knowledge are like scrolls and rune stones to tech people these days.

I'm old enough to have used modems and never heard the long name before.

Re: Unix command line conventions over time

#107

I was at Bell during the options “debate.” I think something that this otherwise wonderful article misses is that some believed that commands were never intended to be the only way to use the system as the shell was intended to be just one of the many user interfaces that Research Unix would provide. From that perspective, it was entirely reasonable to believe that if a command was so complex that it needed options t…

Interesting, any chance you could expand on these 'other user interfaces'? I'm not really familiar with Unix itself, but I've always considered Linux a shell-first OS (as opposed to Windows (NT), which I consider a GUI-first OS).

A shell is just how you interact with the underlying system. The gui is also a shell. Confusing I know!

Re: Unix command line conventions over time

#108

Earlier quoted context omitted.

For some reason, this seems to be vanishingly scarce knowledge in Linux / Unix circles. There was someone on HN a couple of weeks ago who was astounded to learn that "modem" means "modulator-demodulator." Like it was some kind of forbidden magic. Things that you an I consider entry-level knowledge are like scrolls and rune stones to tech people these days.

I'm old enough to have used modems and never heard the long name before.

I remember when the internet used to scream at me. I remember the proper name of a modem from my ancient CompTIA A+ classes I took as a teenager.

Re: Unix command line conventions over time

#109

If Apple made the transition to OS X in a position of strength, like the one it enjoys today, I think it may had imposed a pattern and rewritten tar, ps, dd, etc. However, the way history has unfolded, I think we’re stuck with this mess for good.

In that case, there wouldn't be any desktop UNIX from Apple, and Copland would have managed to eventually make it.

Re: Unix command line conventions over time

#110
Example in "Early 1970s" is notoriously bad.

Text says: "it would be given some number of filenames as command line arguments, and it would read those ... Options didn’t exist".

Example shows: unneeded usage of `cat` as if `wc` is non-standard utility and cannot process file names by itself, option for `wc` is used. It contradicts text in both ways!

Post reply on HN