0

Once, I've learned that options of Linux commands came in two manners:

  • those of one letter, prefixed by a -
  • those of many letters, prefixed by a --

And this works in 95% of the cases.

But not, for example, for the find command. This one fails:

find . --name myfilename

And this one is working:

find . -name myfilename

Either I'm wrong with my belief that options start by - or -- depending on their number of letters,

Either find command should, I agree, retain for compatibility it's ability to run with the -name option, but it should also accept the --name option.

What's the truth ?

1 Answers1

2

What you're learned is more like what you'd call guidelines than actual rules. Or maybe they should be called customs.

The harsh reality is that there are no rules and trying to model the existing tools, with all of the historical compatibility baggage they have, through some clean and nice rules is bound to end in tears.

The tests/actions/whatever of find are one thing, single dash long arguments like in X utilities (-geometry) are another, stuff like tar czf and dd if=... yet another.

See also:

ilkkachu
  • 138,973