In traditional Unix, options were one letter, like
ls -l or
ls -d. In some cases the option would take an argument, as in
cut -d: -f1 /etc/passwd (
-d (delimiter) with value
-f (fields to select) with value
1). Where the options didn't take arguments, instead of
ls -l -d -F /tmp/* you can write
ls -ldF /tmp/*. Some commands take options starting with
more +10 file starts
more(1) on line 10 of
I believe it was the GNU project around '87 or so who introduced the idea of long options, like
cut --delimiter=: --fields=1 /etc/passwd means the same as the cryptic command above in GNU's
cut. This gives quite more readable options, and works around there being only 62 letters and digits, which is much too few options for e.g.
ls(1)... thus we have
gcc -c -O2 --fomit-frame-pointer xxx.c and such.
Some heretic commands use long options starting with just
convert -adjoin -authenticate passwd some.jpg graphic.gif files.png -o here.pdf (from ImageMagick, the
-adjoin places the images together, the
-authenticate takes a password; this is just smashed together from the manual page's options list, this combination might make no sense).
Many commands (but not all, and it depends on what Unix flavor is your poison) take
-- to mean "following isn't options anymore, even if it looks like options", so with GNU's
rm(1) you can get rid of the
-rf file commonly created as a stupid prank by
rm -- -rf.