Reading '--help' in Linux
I am confused on something. Lets say that I enter a command of # ls --help
and it echos out this: sean@thebrains:~$ ls --help Usage: ls [OPTION]... [FILE]... List information about the FILEs (the current directory by default). Sort entries alphabetically if none of -cftuvSUX nor --sort. Mandatory arguments to long options are mandatory for short options too. -a, --all do not ignore entries starting with . -A, --almost-all do not list implied . and .. --author with -l, print the author of each file -b, --escape print octal escapes for nongraphic characters --block-size=SIZE use SIZE-byte blocks -B, --ignore-backups do not list implied entries ending with ~ -c with -lt: sort by, and show, ctime (time of last modification of file status information) with -l: show ctime and sort by name otherwise: sort by ctime -C list entries by columns --color[=WHEN] control whether color is used to distinguish file types. WHEN may be `never', `always', or `auto' ------------------------- Now if you look at the top argument ' -a --all' does the --all mean that, that is the long way to write the argument? Also '-A --almost-all, and the --author, what does that imply, that I need to use:'ls -A --almost-all --author' ?? Sorry for being a complete dumba**.... |
-a, --all do not ignore entries starting with .
-a and --all are the same command just two different methods of writing it. The more common practice now adays is to use the "long format" or the --all. -A, --almost-all do not list implied . and .. These two statements are also the same see explaniation above HOWEVER they are not the same as "-a --all" I suggest you run the two to see the difference. ls --all ls --almost-all HTH, Paul |
If you have difficulties with the built-in help response, then try 'man ls' or 'info ls'. Maybe these will be more readable to you.
|
Quote:
|
AIUI, the long forms of options are designed mostly for use inside of scripts, where readability (i.e. quickly understanding what the command is doing) is important, and the effort of typing the full string only has to be done once.
For regular command line use, the short forms are more natural. The "--help" option is usually only used as a quick reference. As mentioned above, read the man or info pages for detailed usage information. |
Quote:
|
I always assumed the short way was more popular, however the long way is easier to humanly understand.
|
All times are GMT -5. The time now is 12:50 AM. |