How exactly do you have to interpret the output of a commands "usage" output, in bash for example.
For example, on my OS X, cp
gives me
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file target_file
cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file ... target_directory
- What does the nested options, like -H within -R, indicate?
- Does upper and lower case have any meaning?
- When is an argument optional, required?
I need to implement a telnet command line against a program of mine and I would like to get this straight.
For anyone trying to understand what usage output means, the best way is to
man man
.seriously :-) Take the time to learn the conventions, it really helps.
First of all, while there are general conventions, they are not uniformly applied.
-R
(indicating "recursion"), then you can use either-H
,-L
, or-P
. If you don't use-R
, then those options are not relevant.-h
and-H
do completely different things.Other points worth noting:
[-fi | -n]
indicates you can use either-f
and/or-i
but not in combination with-n
.[-apvX]
indicates you can use any combination of those options. They don't even need to be smashed together. So-a -v -p
would be a valid combination.