3 ms·
From the manual: "In UNIX or short-option style, each option letter is prefixed with a single dash, as in other command line utilities. If an option ta
by TuringTest 11y ago
From the manual:
"In UNIX or short-option style, each option letter is prefixed with a
single dash, as in other command line utilities. If an option takes
argument, the argument follows it, either as a separate command line
word, or immediately following the option. However, if the option
takes an optional argument, the argument must follow the option letter without any intervening whitespace, as in -g/tmp/snar.db. Any number of options not taking arguments can be clustered together
after a single dash, e.g. -vkp. Options that take arguments (whether
mandatory or optional), can appear at the end of such a cluster, e.g.
-vkpf a.tar."
When you have several alternative optional syntaxes for the commands, and you mix them with several different mandatory syntaxes for the parameters, the result is way more complex than merely "know five simple parameters for 99% use cases".
The following are all valid ways to do exactly the same thing:
tar cfv a.tar /etc
tar -cvf a.tar /etc
tar -c -v -f a.tar /etc
tar --create --file a.tar --verbose /etc
tar --cre --file=a.tar --verb /etc
This offers lots of flexibility, but also means that it will be hard to remember the exact syntax, and that examples that you come by on the net will all look wildly different, making it hard to learn the commands and create a habit by exposure to examples.