News for hackers. Stuff that matters.
Re:Unix command line conventions over time by nohackeratall on Saturday May 07, 2022 @07:50AM (#31293799)
And then you have ImageMagick where the order of flags and options is a science by itself.
Re:Unix command line conventions over time by sph on Saturday May 07, 2022 @09:01AM (#31294156)
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.

Re:Unix command line conventions over time by floren on Saturday May 07, 2022 @11:13AM (#31295177)
Regarding default ps output: remember how people were using Unix in the old days. Logged in via a text terminal on a multiuser system, 99% the only processes you care about are those associated with the current terminal, and that's what ps shows by default. You might have half a dozen backgrounded programs running in that terminal, but that's about it.

Now, my X sessions always have a dozen xterms running and plain ps isn't very useful, but it might break scripts if they changed it...

Re:Unix command line conventions over time by veltas on Saturday May 07, 2022 @02:14PM (#31297047)
Yeah this is the problem, the 'terminal' used to be the box/machine in-front of you. Now a 'terminal' is pretty much just a window or tab most of the time.
Re:Unix command line conventions over time by spijdar on Saturday May 07, 2022 @10:44AM (#31294893)
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.
Re:Unix command line conventions over time by kps on Saturday May 07, 2022 @12:02PM (#31295707)
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 by kitschyred on Saturday May 07, 2022 @03:13PM (#31297600)
> Talk about bad UX.

I think you could say this for CLIs in general. While we can all agree that the CLI is great for tasks that require repetition; it's just a PITA for any one-time task. When you just need to do something once and as soon as possible, the manual-help-type-run loop gets tiresome quickly.

Passing options to a program so it can do what most users would want it to do in the first place is nonsensical, and yet that describes the behaviour of many if not all of *nix's tools. It should be the other way around: do what is expected by default, and provide options for different, more uncommon use-cases. Though I suppose this is also a form of baggage from the past that it's very difficult to get rid off because of backwards compatibility.

Re:Unix command line conventions over time by codethief on Saturday May 07, 2022 @01:05PM (#31296417)
Have you tried `ps faux`? :)
Re:Unix command line conventions over time by wchar_t on Saturday May 07, 2022 @08:09AM (#31293887)
Indeed, I passionately hate programs where the order of the options and files/arguments matter just as much as the options themselves.
Re:Unix command line conventions over time by zvr on Saturday May 07, 2022 @09:01AM (#31294160)
Given that ImageMagick can describe a sequence of operations (much like commands piped together), the order is obviously significant.

The exact same holds for ffmpeg command-line.

Re:Unix command line conventions over time by loudmax on Saturday May 07, 2022 @10:25AM (#31294740)
The `find` command is extremely useful, but user-friendly, it is not.

  $ find -type f Data/
  find: paths must precede expression: `Data/'
  find: possible unquoted pattern after predicate `-type'?
sigh
Re:Unix command line conventions over time by chengiz on Saturday May 07, 2022 @09:01AM (#31294157)
I think Imagemagick and maybe git are where I require a web search most often, along with hope that someone has had the same need before.
Re:Unix command line conventions over time by jbverschoor on Saturday May 07, 2022 @08:15AM (#31293920)
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
Re:Unix command line conventions over time by nocman on Saturday May 07, 2022 @11:55AM (#31295591)
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 by professorsnep on Saturday May 07, 2022 @04:16PM (#31298145)
ffmpeg too! Been doing a lot with it lately and I barely even feel like I have scratched the service of the ffmpeg argument science.