what are the options with double hyphen
i have seen if i do man ls i get to see some options with double hyphen (--)
for example --author Can anyone elaborate on this |
They function the same as their shorter counter parts. "cp -r", works the same as "cp --recursive"
you can use them in the same way as you would a normal option. ie: Code:
$ ls -lha --author --color Code:
$ ls -lha --author --color --full-time Edit: I should also add, their doesnt HAVE to be a short cut for a long option, as is the case with my examples. |
you mean i can use either way like
ls --l, ls -l, or ls --long i don't think i can there must be some specific reason. you said there is no special meaning to them, in that case why only few option have double hyphen? |
I think you have misunderstood.
Some(!) options to some(!) cmds have '--' versions, but not all. There's no rule as to which. In traditional *nix, all tool options were short, but when the GNU toolset came along (ie free toolset), they started adding long versions to make them easier to read. In fact you may see them referred to as GNU-style options. You just have to read the man page or eg http://linux.die.net/man/ for a given cmd to see which ones exist. In some cases a new long option was introduced to a cmd because the obvious one-letter version was already taken, but had a different meaning to the new option. you may want to read this and the links therein http://stackoverflow.com/questions/4...d-line-options |
Quote:
If you see the man page of ls there is only -l, not --l. And for some of the switches there are --(double hyphens) used and -(single hyphen) for shortcut of those --(double hyphens), e.g., '-i' is the shortcut for '--inode', '-a' is the sortcut for '--all'. I again repeat refer to man pages and try to understand those man pages. :) |
All times are GMT -5. The time now is 10:35 AM. |