coreutils: Common options

1 
1 2 Common options
1 ****************
1 
1 Certain options are available in all of these programs.  Rather than
1 writing identical descriptions for each of the programs, they are
1 described here.  (In fact, every GNU program accepts (or should accept)
1 these options.)
1 
1    Normally options and operands can appear in any order, and programs
1 act as if all the options appear before any operands.  For example,
1 ‘sort -r passwd -t :’ acts like ‘sort -r -t : passwd’, since ‘:’ is an
1 option-argument of ‘-t’.  However, if the ‘POSIXLY_CORRECT’ environment
1 variable is set, options must appear before operands, unless otherwise
1 specified for a particular command.
1 
1    A few programs can usefully have trailing operands with leading ‘-’.
1 With such a program, options must precede operands even if
1 ‘POSIXLY_CORRECT’ is not set, and this fact is noted in the program
1 description.  For example, the ‘env’ command’s options must appear
1 before its operands, since in some cases the operands specify a command
1 that itself contains options.
1 
1    Most programs that accept long options recognize unambiguous
1 abbreviations of those options.  For example, ‘rmdir
1 --ignore-fail-on-non-empty’ can be invoked as ‘rmdir --ignore-fail’ or
1 even ‘rmdir --i’.  Ambiguous options, such as ‘ls --h’, are identified
1 as such.
1 
1    Some of these programs recognize the ‘--help’ and ‘--version’ options
1 only when one of them is the sole command line argument.  For these
1 programs, abbreviations of the long options are not always recognized.
1 
1 ‘--help’
1      Print a usage message listing all available options, then exit
1      successfully.
1 
1 ‘--version’
1      Print the version number, then exit successfully.
1 
1 ‘--’
1      Delimit the option list.  Later arguments, if any, are treated as
1      operands even if they begin with ‘-’.  For example, ‘sort -- -r’
1      reads from the file named ‘-r’.
1 
1    A single ‘-’ operand is not really an option, though it looks like
1 one.  It stands for a file operand, and some tools treat it as standard
1 input, or as standard output if that is clear from the context.  For
1 example, ‘sort -’ reads from standard input, and is equivalent to plain
1 ‘sort’.  Unless otherwise specified, a ‘-’ can appear as any operand
1 that requires a file name.
1 

Menu