this post was submitted on 26 Mar 2026
60 points (96.9% liked)

Linux

64148 readers
352 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 6 years ago
MODERATORS
 

Regardless of what the app does and whether the thing that does is particularly useful, powerful or important for what you need to do (or even well implemented), what is a command-line interface that you had a particularly good experience both learning and working with?

In other words, I'm thinking about command line interface design patterns that tend to correlate with good user experience.

"Good user experience" being vague, what I mean is, including (but not limited to)

  • discoverability--learning what features are available),
  • usability--those features actually being useful,
  • and expressiveness--being able to do more with less words without losing clarity,

but if there's a CLI that has none of those but you still like it, I'd be happy to hear about it.

Edit: Trying to stress more that this post is not about the functionality behind the tool. Looks like most of first responders missed the nuance: whether app x is better than app y because it does x1 ad x2 differently or better does not matter; I'm purely interested in how the command line interface is designed (short/long flags, sub-commands, verbs, nouns, output behaviors)..

you are viewing a single comment's thread
view the rest of the comments
[–] CodenameDarlen@lemmy.world 23 points 2 days ago* (last edited 2 days ago) (3 children)

I like CLI tools that everything I need can be found in a short command --help call, if I don't need to use man command it's even better.

I've used poor CLI tools for example adb you type this and you get almost a scientific article with more than 100 flags to use. No I don't want to need to use grep.

A good one would be pacman it separates clearly what it does instead of shoving it all in a single command.

[–] unwarlikeExtortion@lemmy.ml 2 points 1 day ago

This is where a man page comes in but alas, but some (perhaps even most) of them are fucking horrible. The core incantation is either too dumbed-down or (more often) too long-winded.

Some good ones I can praise are netcat, ghostscript and 7z. Special praise goes to the Library Funtions Manual entries like signal and exit.

Bad ones ones in my book are vim (too short), ffmpeg (a simple reordering of sections would make it quite a bit better, like moving the less common flags lower down the page) and git starts of strong but ends up being way too detailed and unstructured.

I could go listing examples for days, so I might as well stop now.

[–] Aatube@thriv.social 16 points 2 days ago (3 children)

Personally I dislike pacman as it uses capital-letter flags as subcommands while I'm used to actual subcommands

[–] thingsiplay@lemmy.ml 2 points 2 days ago (1 children)

You can use long option names instead too, as each capital letter mode has a long option name, such as -R --remove and -S --sync.

[–] Aatube@thriv.social 5 points 2 days ago (1 children)

My problem is that it's a flag and not like # pacman remove

[–] thingsiplay@lemmy.ml 1 points 2 days ago (2 children)

I don't get why that is a problem. It's just an option name with 2 dashes in front. In fact, that is the "correct" way of handling options, as in standard option processing in GNU / Linux. I personally dislike options without dash, but on the other hand it does not bother me enough to be bothered by it. pacman --remove is almost identical to pacman remove, so I don't know why that is a "problem".

[–] deczzz@lemmy.dbzer0.com 1 points 1 day ago (1 children)

Is there a difference between one dash - vs two dashes -- ? I don't get why it makes sense to use two as its just an extra key press?

Sorry for going a bit off topic here

[–] thingsiplay@lemmy.ml 1 points 1 day ago

No problem, it's always good idea to ask.

By convention two dashes -- are used for options with long name, such as --remove, while single dash - is used for single letter options such as -R. There can be some extra rules how options are used and combined, but that is not always true for every application. A common implementation is that options with single dash can be combined to have less to press, while double dash options cannot. Meaning if you have options -a -b -c then you could combine them into one bucket as -abc or -ab -c, all equivalent. But you cannot combine --remove -a -b into --abremove in example. There can be some extra rules and some applications handle options bit differently.

[–] Aatube@thriv.social 3 points 2 days ago (1 children)

Because it's not an option but a subcommand.

as in standard option processing in GNU / Linux

Guix and standard tooling like perf also use subcommands. I'm used to flags/options modifying the way the same inputs are processed, not completely changing what you give as $1.

[–] thingsiplay@lemmy.ml 0 points 2 days ago (1 children)

But its just a matter of 2 dashes. It shouldn't be a problem.

[–] Aatube@thriv.social 3 points 2 days ago* (last edited 2 days ago) (1 children)

You misunderstand me. It's not about typing it. It's not conforming to prevalent Linux paradigms which creates artificial confusion and learning difficulties. There's a reason it's git pull and not git -L, perf annotate and not perf -A . It's a great semantic difference like <b> vs <h3>. I'm saying this as an Arch user.

[–] thingsiplay@lemmy.ml 1 points 2 days ago (1 children)

I don't think it would make ANY difference if the option was named git --pull instead git pull (you don't have to use the single uppercase). That is NOT the same semantic difference between and , because it (the pull example) operates the same as before. The only difference are the two dashes. I don't see how this creates confusion or learning difficulties.

[–] Aatube@thriv.social 2 points 2 days ago (1 children)

The prevalent way (except for ancient tools like tar), and thus the norm, is that options are meant to be optional and subcommands are like old "do one thing" Unix commands (do completely different things, can have completely different set of arguments) but you prepend the name of the software in front of them. You can see the impact of this reflected in documentation for argument parsers: https://docs.python.org/3.14/library/argparse.html#%3A%7E%3Atext=Required+options+are+generally+considered+bad+form+because+users+expect+options+to+be+optional https://gobyexample.com/command-line-subcommands#%3A%7E%3Atext=Command-Line+Subcommands-%2CGo+by+Example%3A+Command-Line+Subcommands%2Cthat+have+their+own+flags.

[–] thingsiplay@lemmy.ml 1 points 2 days ago (1 children)

I know how subcommands work. But that is not the point I am making. Having two dashes in front of it or not like pacman remove or pacman --remove does not change how the command operates. It is literally having two dashes or not and therefore is not an issue.

[–] Ephera@lemmy.ml 3 points 2 days ago

Hmm, I don't know about Pacman, but for example openSUSE's zypper remove has a --clean-deps flag, which doesn't exist on the other subcommands. So, it wouldn't make sense to have it be zypper --remove --clean-deps...

[–] CodenameDarlen@lemmy.world 2 points 2 days ago (1 children)

But you can find a good short description about each option with -hS. It's well designed in my opinion because of that, no need to go far to understand it.

[–] Aatube@thriv.social 1 points 2 days ago* (last edited 2 days ago)

That's good documentation, not good interface

Edit: For example you could've had pacman sync -h instead

[–] bradboimler@lemmy.world 1 points 2 days ago (1 children)

Why in the world is -S used for install?

[–] thingsiplay@lemmy.ml 2 points 2 days ago

-S stands for "sync". You are syncing to the online database.

[–] carmo55@lemmy.zip 5 points 2 days ago (1 children)

Pacman flags not being idempotent (-SS, yy, uu and such existing) is so unbelievably horrible that I can't use arch just because of it.

[–] jonathan@piefed.social 1 points 2 days ago (1 children)

I've never used Arch, can you explain how it behaves?

[–] carmo55@lemmy.zip 3 points 1 day ago (1 children)

The flag -y refreshes the package list (like apt update). For some reason, you use the flag -yy to force it to clear the whole package list and redownload everything.

To allow package downgrades when upgrading you use -uu.

These are very commonly suggested fixes to arch package management problems, for example when you leave your arch install to suit for too long, it will be impossible to update it because of dependency problems. So you google it and people are saying to run "pacman -SSyyuu" or other such commands.

Those additional options should be their own flags, command line flags should be idempotent (it should flip a switch on, doing it multiple times shouldn't change anything).

[–] jonathan@piefed.social 1 points 1 day ago

Okay yeah that's terrible