Follow

Wrote in my blog about Unix command line conventions over time.

blog.liw.fi/posts/2022/05/07/u

@liw

A bit more history you might find interesting —

The pipe symbol used to chain commands together is: “|”.

But originally it was “^”.

@liw I first came across '--' in xinit as the separator for client/server options.

GNU also added standard options: almost every GNU program supports the options --help, --version, and --mail=ADDR.

@liw, channeling jwz

@liw “Everything seems to require per-subcommand options to come after the subcommand.” – I’m jumping a few decades ahead, but systemd commands don’t care where options go. `systemctl --now enable --user UNIT` is valid, even though semantically --now is specific to the enable subcommand but --user affects any systemctl invocation. And yes this has always bothered me compared to Git ^^

@liw The '--' for separating options from arguments seems to date from the original version of getopt(3), which appears to come from System III in 1980 or so (www.tuhs.org has the System III manpages).

@liw
Very amusing read. It takes a hustory lesson to realize how much complexity one has absorbed and how confusing it can be to a beginner.

Some things which were not mentioned in your article:
1. The convention of using a single hyphen -. It emphasizes that it expects data from standard input.
2. The modern madness of commands with 3 to 4 levels of subcommands. Yes, I am looking at you, container tech. kubectl, gcloud and what not

Sign in to participate in the conversation
toot.liw.fi

Lars and friends