(linenum→info "unix/slp.c:2238")

coreutils/6.9/doc/coreutils.info

    1: This is coreutils.info, produced by makeinfo version 4.8 from
    2: coreutils.texi.
    3: 
    4: INFO-DIR-SECTION Basics
    5: START-INFO-DIR-ENTRY
    6: * Coreutils: (coreutils).       Core GNU (file, text, shell) utilities.
    7: * Common options: (coreutils)Common options.      Common options.
    8: * File permissions: (coreutils)File permissions.  Access modes.
    9: * Date input formats: (coreutils)Date input formats.
   10: END-INFO-DIR-ENTRY
   11: 
   12: INFO-DIR-SECTION Individual utilities
   13: START-INFO-DIR-ENTRY
   14: * base64: (coreutils)base64 invocation.         Base64 encode/decode data.
   15: * basename: (coreutils)basename invocation.     Strip directory and suffix.
   16: * cat: (coreutils)cat invocation.               Concatenate and write files.
   17: * chgrp: (coreutils)chgrp invocation.           Change file groups.
   18: * chmod: (coreutils)chmod invocation.           Change file permissions.
   19: * chown: (coreutils)chown invocation.           Change file owners/groups.
   20: * chroot: (coreutils)chroot invocation.         Specify the root directory.
   21: * cksum: (coreutils)cksum invocation.           Print POSIX CRC checksum.
   22: * comm: (coreutils)comm invocation.             Compare sorted files by line.
   23: * cp: (coreutils)cp invocation.                 Copy files.
   24: * csplit: (coreutils)csplit invocation.         Split by context.
   25: * cut: (coreutils)cut invocation.               Print selected parts of lines.
   26: * date: (coreutils)date invocation.             Print/set system date and time.
   27: * dd: (coreutils)dd invocation.                 Copy and convert a file.
   28: * df: (coreutils)df invocation.                 Report file system disk usage.
   29: * dir: (coreutils)dir invocation.               List directories briefly.
   30: * dircolors: (coreutils)dircolors invocation.   Color setup for ls.
   31: * dirname: (coreutils)dirname invocation.       Strip non-directory suffix.
   32: * du: (coreutils)du invocation.                 Report on disk usage.
   33: * echo: (coreutils)echo invocation.             Print a line of text.
   34: * env: (coreutils)env invocation.               Modify the environment.
   35: * expand: (coreutils)expand invocation.         Convert tabs to spaces.
   36: * expr: (coreutils)expr invocation.             Evaluate expressions.
   37: * factor: (coreutils)factor invocation.         Print prime factors
   38: * false: (coreutils)false invocation.           Do nothing, unsuccessfully.
   39: * fmt: (coreutils)fmt invocation.               Reformat paragraph text.
   40: * fold: (coreutils)fold invocation.             Wrap long input lines.
   41: * groups: (coreutils)groups invocation.         Print group names a user is in.
   42: * head: (coreutils)head invocation.             Output the first part of files.
   43: * hostid: (coreutils)hostid invocation.         Print numeric host identifier.
   44: * hostname: (coreutils)hostname invocation.     Print or set system name.
   45: * id: (coreutils)id invocation.                 Print user identity.
   46: * install: (coreutils)install invocation.       Copy and change attributes.
   47: * join: (coreutils)join invocation.             Join lines on a common field.
   48: * kill: (coreutils)kill invocation.             Send a signal to processes.
   49: * link: (coreutils)link invocation.             Make hard links between files.
   50: * ln: (coreutils)ln invocation.                 Make links between files.
   51: * logname: (coreutils)logname invocation.       Print current login name.
   52: * ls: (coreutils)ls invocation.                 List directory contents.
   53: * md5sum: (coreutils)md5sum invocation.         Print or check MD5 digests.
   54: * mkdir: (coreutils)mkdir invocation.           Create directories.
   55: * mkfifo: (coreutils)mkfifo invocation.         Create FIFOs (named pipes).
   56: * mknod: (coreutils)mknod invocation.           Create special files.
   57: * mv: (coreutils)mv invocation.                 Rename files.
   58: * nice: (coreutils)nice invocation.             Modify niceness.
   59: * nl: (coreutils)nl invocation.                 Number lines and write files.
   60: * nohup: (coreutils)nohup invocation.           Immunize to hangups.
   61: * od: (coreutils)od invocation.                 Dump files in octal, etc.
   62: * paste: (coreutils)paste invocation.           Merge lines of files.
   63: * pathchk: (coreutils)pathchk invocation.       Check file name portability.
   64: * pr: (coreutils)pr invocation.                 Paginate or columnate files.
   65: * printenv: (coreutils)printenv invocation.     Print environment variables.
   66: * printf: (coreutils)printf invocation.         Format and print data.
   67: * ptx: (coreutils)ptx invocation.               Produce permuted indexes.
   68: * pwd: (coreutils)pwd invocation.               Print working directory.
   69: * readlink: (coreutils)readlink invocation.     Print referent of a symlink.
   70: * rm: (coreutils)rm invocation.                 Remove files.
   71: * rmdir: (coreutils)rmdir invocation.           Remove empty directories.
   72: * seq: (coreutils)seq invocation.               Print numeric sequences
   73: * sha1sum: (coreutils)sha1sum invocation.       Print or check SHA-1 digests.
   74: * sha2: (coreutils)sha2 utilities.              Print or check SHA-2 digests.
   75: * shred: (coreutils)shred invocation.           Remove files more securely.
   76: * shuf: (coreutils)shuf invocation.             Shuffling text files.
   77: * sleep: (coreutils)sleep invocation.           Delay for a specified time.
   78: * sort: (coreutils)sort invocation.             Sort text files.
   79: * split: (coreutils)split invocation.           Split into fixed-size pieces.
   80: * stat: (coreutils)stat invocation.             Report file(system) status.
   81: * stty: (coreutils)stty invocation.             Print/change terminal settings.
   82: * su: (coreutils)su invocation.                 Modify user and group ID.
   83: * sum: (coreutils)sum invocation.               Print traditional checksum.
   84: * sync: (coreutils)sync invocation.             Synchronize memory and disk.
   85: * tac: (coreutils)tac invocation.               Reverse files.
   86: * tail: (coreutils)tail invocation.             Output the last part of files.
   87: * tee: (coreutils)tee invocation.               Redirect to multiple files.
   88: * test: (coreutils)test invocation.             File/string tests.
   89: * touch: (coreutils)touch invocation.           Change file timestamps.
   90: * tr: (coreutils)tr invocation.                 Translate characters.
   91: * true: (coreutils)true invocation.             Do nothing, successfully.
   92: * tsort: (coreutils)tsort invocation.           Topological sort.
   93: * tty: (coreutils)tty invocation.               Print terminal name.
   94: * uname: (coreutils)uname invocation.           Print system information.
   95: * unexpand: (coreutils)unexpand invocation.     Convert spaces to tabs.
   96: * uniq: (coreutils)uniq invocation.             Uniquify files.
   97: * unlink: (coreutils)unlink invocation.         Removal via unlink(2).
   98: * users: (coreutils)users invocation.           Print current user names.
   99: * vdir: (coreutils)vdir invocation.             List directories verbosely.
  100: * wc: (coreutils)wc invocation.                 Line, word, and byte counts.
  101: * who: (coreutils)who invocation.               Print who is logged in.
  102: * whoami: (coreutils)whoami invocation.         Print effective user ID.
  103: * yes: (coreutils)yes invocation.               Print a string indefinitely.
  104: END-INFO-DIR-ENTRY
  105: 
  106:    This manual documents version 6.9 of the GNU core utilities,
  107: including the standard programs for text and file manipulation.
  108: 
  109:    Copyright (C) 1994, 1995, 1996, 2000, 2001, 2002, 2003, 2004, 2005,
  110: 2006 Free Software Foundation, Inc.
  111: 
  112:      Permission is granted to copy, distribute and/or modify this
  113:      document under the terms of the GNU Free Documentation License,
  114:      Version 1.2 or any later version published by the Free Software
  115:      Foundation; with no Invariant Sections, with no Front-Cover Texts,
  116:      and with no Back-Cover Texts.  A copy of the license is included
  117:      in the section entitled "GNU Free Documentation License".
  118: 
  119: 
  120: File: coreutils.info,  Node: Top,  Next: Introduction,  Up: (dir)
  121: 
  122: GNU Coreutils
  123: *************
  124: 
  125: This manual documents version 6.9 of the GNU core utilities, including
  126: the standard programs for text and file manipulation.
  127: 
  128:    Copyright (C) 1994, 1995, 1996, 2000, 2001, 2002, 2003, 2004, 2005,
  129: 2006 Free Software Foundation, Inc.
  130: 
  131:      Permission is granted to copy, distribute and/or modify this
  132:      document under the terms of the GNU Free Documentation License,
  133:      Version 1.2 or any later version published by the Free Software
  134:      Foundation; with no Invariant Sections, with no Front-Cover Texts,
  135:      and with no Back-Cover Texts.  A copy of the license is included
  136:      in the section entitled "GNU Free Documentation License".
  137: 
  138: * Menu:
  139: 
  140: * Introduction::                       Caveats, overview, and authors.
  141: * Common options::                     Common options.
  142: * Output of entire files::             cat tac nl od
  143: * Formatting file contents::           fmt pr fold
  144: * Output of parts of files::           head tail split csplit
  145: * Summarizing files::                  wc sum cksum md5sum sha1sum sha2
  146: * Operating on sorted files::          sort shuf uniq comm ptx tsort
  147: * Operating on fields within a line::  cut paste join
  148: * Operating on characters::            tr expand unexpand
  149: * Directory listing::                  ls dir vdir dircolors
  150: * Basic operations::                   cp dd install mv rm shred
  151: * Special file types::                 ln mkdir rmdir mkfifo mknod
  152: * Changing file attributes::           chgrp chmod chown touch
  153: * Disk usage::                         df du stat sync
  154: * Printing text::                      echo printf yes
  155: * Conditions::                         false true test expr
  156: * Redirection::                        tee
  157: * File name manipulation::             dirname basename pathchk
  158: * Working context::                    pwd stty printenv tty
  159: * User information::                   id logname whoami groups users who
  160: * System context::                     date uname hostname hostid
  161: * Modified command invocation::        chroot env nice nohup su
  162: * Process control::                    kill
  163: * Delaying::                           sleep
  164: * Numeric operations::                 factor seq
  165: * File permissions::                   Access modes.
  166: * Date input formats::                 Specifying date strings.
  167: * Opening the software toolbox::       The software tools philosophy.
  168: * Copying This Manual::                License for copying this manual.
  169: * Index::                              General index.
  170: 
  171:  --- The Detailed Node Listing ---
  172: 
  173: Common Options
  174: 
  175: * Exit status::                 Indicating program success or failure.
  176: * Backup options::              Backup options
  177: * Block size::                  Block size
  178: * Disambiguating names and IDs:: chgrp and chown owner and group syntax
  179: * Random sources::              Sources of random data
  180: * Target directory::            Target directory
  181: * Trailing slashes::            Trailing slashes
  182: * Traversing symlinks::         Traversing symlinks to directories
  183: * Treating / specially::        Treating / specially
  184: * Standards conformance::       Standards conformance
  185: 
  186: Output of entire files
  187: 
  188: * cat invocation::              Concatenate and write files.
  189: * tac invocation::              Concatenate and write files in reverse.
  190: * nl invocation::               Number lines and write files.
  191: * od invocation::               Write files in octal or other formats.
  192: * base64 invocation::           Transform data into printable data.
  193: 
  194: Formatting file contents
  195: 
  196: * fmt invocation::              Reformat paragraph text.
  197: * pr invocation::               Paginate or columnate files for printing.
  198: * fold invocation::             Wrap input lines to fit in specified width.
  199: 
  200: Output of parts of files
  201: 
  202: * head invocation::             Output the first part of files.
  203: * tail invocation::             Output the last part of files.
  204: * split invocation::            Split a file into fixed-size pieces.
  205: * csplit invocation::           Split a file into context-determined pieces.
  206: 
  207: Summarizing files
  208: 
  209: * wc invocation::               Print newline, word, and byte counts.
  210: * sum invocation::              Print checksum and block counts.
  211: * cksum invocation::            Print CRC checksum and byte counts.
  212: * md5sum invocation::           Print or check MD5 digests.
  213: * sha1sum invocation::          Print or check SHA-1 digests.
  214: * sha2 utilities::              Print or check SHA-2 digests.
  215: 
  216: Operating on sorted files
  217: 
  218: * sort invocation::             Sort text files.
  219: * shuf invocation::             Shuffle text files.
  220: * uniq invocation::             Uniquify files.
  221: * comm invocation::             Compare two sorted files line by line.
  222: * ptx invocation::              Produce a permuted index of file contents.
  223: * tsort invocation::            Topological sort.
  224: 
  225: `ptx': Produce permuted indexes
  226: 
  227: * General options in ptx::      Options which affect general program behavior.
  228: * Charset selection in ptx::    Underlying character set considerations.
  229: * Input processing in ptx::     Input fields, contexts, and keyword selection.
  230: * Output formatting in ptx::    Types of output format, and sizing the fields.
  231: * Compatibility in ptx::        The GNU extensions to `ptx'
  232: 
  233: Operating on fields within a line
  234: 
  235: * cut invocation::              Print selected parts of lines.
  236: * paste invocation::            Merge lines of files.
  237: * join invocation::             Join lines on a common field.
  238: 
  239: Operating on characters
  240: 
  241: * tr invocation::               Translate, squeeze, and/or delete characters.
  242: * expand invocation::           Convert tabs to spaces.
  243: * unexpand invocation::         Convert spaces to tabs.
  244: 
  245: `tr': Translate, squeeze, and/or delete characters
  246: 
  247: * Character sets::              Specifying sets of characters.
  248: * Translating::                 Changing one set of characters to another.
  249: * Squeezing::                   Squeezing repeats and deleting.
  250: 
  251: Directory listing
  252: 
  253: * ls invocation::               List directory contents
  254: * dir invocation::              Briefly list directory contents
  255: * vdir invocation::             Verbosely list directory contents
  256: * dircolors invocation::        Color setup for `ls'
  257: 
  258: `ls':  List directory contents
  259: 
  260: * Which files are listed::      Which files are listed
  261: * What information is listed::  What information is listed
  262: * Sorting the output::          Sorting the output
  263: * More details about version sort::  More details about version sort
  264: * General output formatting::   General output formatting
  265: * Formatting the file names::   Formatting the file names
  266: 
  267: Basic operations
  268: 
  269: * cp invocation::               Copy files and directories
  270: * dd invocation::               Convert and copy a file
  271: * install invocation::          Copy files and set attributes
  272: * mv invocation::               Move (rename) files
  273: * rm invocation::               Remove files or directories
  274: * shred invocation::            Remove files more securely
  275: 
  276: Special file types
  277: 
  278: * link invocation::             Make a hard link via the link syscall
  279: * ln invocation::               Make links between files
  280: * mkdir invocation::            Make directories
  281: * mkfifo invocation::           Make FIFOs (named pipes)
  282: * mknod invocation::            Make block or character special files
  283: * readlink invocation::         Print the referent of a symbolic link
  284: * rmdir invocation::            Remove empty directories
  285: * unlink invocation::           Remove files via unlink syscall
  286: 
  287: Changing file attributes
  288: 
  289: * chown invocation::            Change file owner and group
  290: * chgrp invocation::            Change group ownership
  291: * chmod invocation::            Change access permissions
  292: * touch invocation::            Change file timestamps
  293: 
  294: Disk usage
  295: 
  296: * df invocation::               Report file system disk space usage
  297: * du invocation::               Estimate file space usage
  298: * stat invocation::             Report file or file system status
  299: * sync invocation::             Synchronize data on disk with memory
  300: 
  301: Printing text
  302: 
  303: * echo invocation::             Print a line of text
  304: * printf invocation::           Format and print data
  305: * yes invocation::              Print a string until interrupted
  306: 
  307: Conditions
  308: 
  309: * false invocation::              Do nothing, unsuccessfully
  310: * true invocation::               Do nothing, successfully
  311: * test invocation::               Check file types and compare values
  312: * expr invocation::               Evaluate expressions
  313: 
  314: `test': Check file types and compare values
  315: 
  316: * File type tests::               File type tests
  317: * Access permission tests::       Access permission tests
  318: * File characteristic tests::     File characteristic tests
  319: * String tests::                  String tests
  320: * Numeric tests::                 Numeric tests
  321: 
  322: `expr': Evaluate expression
  323: 
  324: * String expressions::         + : match substr index length
  325: * Numeric expressions::        + - * / %
  326: * Relations for expr::         | & < <= = == != >= >
  327: * Examples of expr::           Examples of using `expr'
  328: 
  329: Redirection
  330: 
  331: * tee invocation::               Redirect output to multiple files
  332: 
  333: File name manipulation
  334: 
  335: * basename invocation::          Strip directory and suffix from a file name
  336: * dirname invocation::           Strip non-directory suffix from a file name
  337: * pathchk invocation::           Check file name portability
  338: 
  339: Working context
  340: 
  341: * pwd invocation::               Print working directory
  342: * stty invocation::              Print or change terminal characteristics
  343: * printenv invocation::          Print all or some environment variables
  344: * tty invocation::               Print file name of terminal on standard input
  345: 
  346: `stty': Print or change terminal characteristics
  347: 
  348: * Control::                     Control settings
  349: * Input::                       Input settings
  350: * Output::                      Output settings
  351: * Local::                       Local settings
  352: * Combination::                 Combination settings
  353: * Characters::                  Special characters
  354: * Special::                     Special settings
  355: 
  356: User information
  357: 
  358: * id invocation::                Print user identity
  359: * logname invocation::           Print current login name
  360: * whoami invocation::            Print effective user ID
  361: * groups invocation::            Print group names a user is in
  362: * users invocation::             Print login names of users currently logged in
  363: * who invocation::               Print who is currently logged in
  364: 
  365: System context
  366: 
  367: * date invocation::              Print or set system date and time
  368: * uname invocation::             Print system information
  369: * hostname invocation::          Print or set system name
  370: * hostid invocation::            Print numeric host identifier.
  371: 
  372: `date': Print or set system date and time
  373: 
  374: * Time conversion specifiers::   %[HIklMNpPrRsSTXzZ]
  375: * Date conversion specifiers::   %[aAbBcCdDeFgGhjmuUVwWxyY]
  376: * Literal conversion specifiers:: %[%nt]
  377: * Padding and other flags::      Pad with zeros, spaces, etc.
  378: * Setting the time::             Changing the system clock.
  379: * Options for date::             Instead of the current time.
  380: * Examples of date::             Examples.
  381: 
  382: Modified command invocation
  383: 
  384: * chroot invocation::            Run a command with a different root directory
  385: * env invocation::               Run a command in a modified environment
  386: * nice invocation::              Run a command with modified niceness
  387: * nohup invocation::             Run a command immune to hangups
  388: * su invocation::                Run a command with substitute user and group ID
  389: 
  390: Process control
  391: 
  392: * kill invocation::              Sending a signal to processes.
  393: 
  394: Delaying
  395: 
  396: * sleep invocation::             Delay for a specified time
  397: 
  398: Numeric operations
  399: 
  400: * factor invocation::            Print prime factors
  401: * seq invocation::               Print numeric sequences
  402: 
  403: File permissions
  404: 
  405: * Mode Structure::               Structure of file mode bits.
  406: * Symbolic Modes::               Mnemonic representation of file mode bits.
  407: * Numeric Modes::                File mode bits as octal numbers.
  408: * Directory Setuid and Setgid::  Set-user-ID and set-group-ID on directories.
  409: 
  410: Date input formats
  411: 
  412: * General date syntax::          Common rules.
  413: * Calendar date items::          19 Dec 1994.
  414: * Time of day items::            9:20pm.
  415: * Time zone items::              EST, PDT, GMT.
  416: * Day of week items::            Monday and others.
  417: * Relative items in date strings:: next tuesday, 2 years ago.
  418: * Pure numbers in date strings:: 19931219, 1440.
  419: * Seconds since the Epoch::      @1078100502.
  420: * Specifying time zone rules::   TZ="America/New_York", TZ="UTC0".
  421: * Authors of get_date::          Bellovin, Eggert, Salz, Berets, et al.
  422: 
  423: Opening the software toolbox
  424: 
  425: * Toolbox introduction::         Toolbox introduction
  426: * I/O redirection::              I/O redirection
  427: * The who command::              The `who' command
  428: * The cut command::              The `cut' command
  429: * The sort command::             The `sort' command
  430: * The uniq command::             The `uniq' command
  431: * Putting the tools together::   Putting the tools together
  432: 
  433: Copying This Manual
  434: 
  435: * GNU Free Documentation License::  License for copying this manual.
  436: 
  437: 
  438: File: coreutils.info,  Node: Introduction,  Next: Common options,  Prev: Top,  Up: Top
  439: 
  440: 1 Introduction
  441: **************
  442: 
  443: This manual is a work in progress: many sections make no attempt to
  444: explain basic concepts in a way suitable for novices.  Thus, if you are
  445: interested, please get involved in improving this manual.  The entire
  446: GNU community will benefit.
  447: 
  448:    The GNU utilities documented here are mostly compatible with the
  449: POSIX standard.  Please report bugs to <bug-coreutils@gnu.org>.
  450: Remember to include the version number, machine architecture, input
  451: files, and any other information needed to reproduce the bug: your
  452: input, what you expected, what you got, and why it is wrong.  Diffs are
  453: welcome, but please include a description of the problem as well, since
  454: this is sometimes difficult to infer.  *Note Bugs: (gcc)Bugs.
  455: 
  456:    This manual was originally derived from the Unix man pages in the
  457: distributions, which were written by David MacKenzie and updated by Jim
  458: Meyering.  What you are reading now is the authoritative documentation
  459: for these utilities; the man pages are no longer being maintained.  The
  460: original `fmt' man page was written by Ross Paterson.  Franc,ois Pinard
  461: did the initial conversion to Texinfo format.  Karl Berry did the
  462: indexing, some reorganization, and editing of the results.  Brian
  463: Youmans of the Free Software Foundation office staff combined the
  464: manuals for textutils, fileutils, and sh-utils to produce the present
  465: omnibus manual.  Richard Stallman contributed his usual invaluable
  466: insights to the overall process.
  467: 
  468: 
  469: File: coreutils.info,  Node: Common options,  Next: Output of entire files,  Prev: Introduction,  Up: Top
  470: 
  471: 2 Common options
  472: ****************
  473: 
  474: Certain options are available in all of these programs.  Rather than
  475: writing identical descriptions for each of the programs, they are
  476: described here.  (In fact, every GNU program accepts (or should accept)
  477: these options.)
  478: 
  479:    Normally options and operands can appear in any order, and programs
  480: act as if all the options appear before any operands.  For example,
  481: `sort -r passwd -t :' acts like `sort -r -t : passwd', since `:' is an
  482: option-argument of `-t'.  However, if the `POSIXLY_CORRECT' environment
  483: variable is set, options must appear before operands, unless otherwise
  484: specified for a particular command.
  485: 
  486:    A few programs can usefully have trailing operands with leading `-'.
  487: With such a program, options must precede operands even if
  488: `POSIXLY_CORRECT' is not set, and this fact is noted in the program
  489: description.  For example, the `env' command's options must appear
  490: before its operands, since in some cases the operands specify a command
  491: that itself contains options.
  492: 
  493:    Some of these programs recognize the `--help' and `--version'
  494: options only when one of them is the sole command line argument.
  495: 
  496: `--help'
  497:      Print a usage message listing all available options, then exit
  498:      successfully.
  499: 
  500: `--version'
  501:      Print the version number, then exit successfully.
  502: 
  503: `--'
  504:      Delimit the option list.  Later arguments, if any, are treated as
  505:      operands even if they begin with `-'.  For example, `sort -- -r'
  506:      reads from the file named `-r'.
  507: 
  508: 
  509:    A single `-' operand is not really an option, though it looks like
  510: one.  It stands for standard input, or for standard output if that is
  511: clear from the context.  For example, `sort -' reads from standard
  512: input, and is equivalent to plain `sort', and `tee -' writes an extra
  513: copy of its input to standard output.  Unless otherwise specified, `-'
  514: can appear as any operand that requires a file name.
  515: 
  516: * Menu:
  517: 
  518: * Exit status::                 Indicating program success or failure.
  519: * Backup options::              -b -S, in some programs.
  520: * Block size::                  BLOCK_SIZE and --block-size, in some programs.
  521: * Disambiguating names and IDs:: chgrp and chown owner and group syntax
  522: * Random sources::              --random-source, in some programs.
  523: * Target directory::            Specifying a target directory, in some programs.
  524: * Trailing slashes::            --strip-trailing-slashes, in some programs.
  525: * Traversing symlinks::         -H, -L, or -P, in some programs.
  526: * Treating / specially::        --preserve-root and --no-preserve-root.
  527: * Special built-in utilities::  `break', `:', `eval', ...
  528: * Standards conformance::       Conformance to the POSIX standard.
  529: 
  530: 
  531: File: coreutils.info,  Node: Exit status,  Next: Backup options,  Up: Common options
  532: 
  533: 2.1 Exit status
  534: ===============
  535: 
  536: Nearly every command invocation yields an integral "exit status" that
  537: can be used to change how other commands work.  For the vast majority
  538: of commands, an exit status of zero indicates success.  Failure is
  539: indicated by a nonzero value--typically `1', though it may differ on
  540: unusual platforms as POSIX requires only that it be nonzero.
  541: 
  542:    However, some of the programs documented here do produce other exit
  543: status values and a few associate different meanings with the values
  544: `0' and `1'.  Here are some of the exceptions: `chroot', `env', `expr',
  545: `nice', `nohup', `printenv', `sort', `su', `test', `tty'.
  546: 
  547: 
  548: File: coreutils.info,  Node: Backup options,  Next: Block size,  Prev: Exit status,  Up: Common options
  549: 
  550: 2.2 Backup options
  551: ==================
  552: 
  553: Some GNU programs (at least `cp', `install', `ln', and `mv') optionally
  554: make backups of files before writing new versions.  These options
  555: control the details of these backups.  The options are also briefly
  556: mentioned in the descriptions of the particular programs.
  557: 
  558: `-b'
  559: `--backup[=METHOD]'
  560:      Make a backup of each file that would otherwise be overwritten or
  561:      removed.  Without this option, the original versions are destroyed.
  562:      Use METHOD to determine the type of backups to make.  When this
  563:      option is used but METHOD is not specified, then the value of the
  564:      `VERSION_CONTROL' environment variable is used.  And if
  565:      `VERSION_CONTROL' is not set, the default backup type is
  566:      `existing'.
  567: 
  568:      Note that the short form of this option, `-b' does not accept any
  569:      argument.  Using `-b' is equivalent to using `--backup=existing'.
  570: 
  571:      This option corresponds to the Emacs variable `version-control';
  572:      the values for METHOD are the same as those used in Emacs.  This
  573:      option also accepts more descriptive names.  The valid METHODs are
  574:      (unique abbreviations are accepted):
  575: 
  576:     `none'
  577:     `off'
  578:           Never make backups.
  579: 
  580:     `numbered'
  581:     `t'
  582:           Always make numbered backups.
  583: 
  584:     `existing'
  585:     `nil'
  586:           Make numbered backups of files that already have them, simple
  587:           backups of the others.
  588: 
  589:     `simple'
  590:     `never'
  591:           Always make simple backups.  Please note `never' is not to be
  592:           confused with `none'.
  593: 
  594: 
  595: `-S SUFFIX'
  596: `--suffix=SUFFIX'
  597:      Append SUFFIX to each backup file made with `-b'.  If this option
  598:      is not specified, the value of the `SIMPLE_BACKUP_SUFFIX'
  599:      environment variable is used.  And if `SIMPLE_BACKUP_SUFFIX' is not
  600:      set, the default is `~', just as in Emacs.
  601: 
  602: 
  603: 
  604: File: coreutils.info,  Node: Block size,  Next: Disambiguating names and IDs,  Prev: Backup options,  Up: Common options
  605: 
  606: 2.3 Block size
  607: ==============
  608: 
  609: Some GNU programs (at least `df', `du', and `ls') display sizes in
  610: "blocks".  You can adjust the block size and method of display to make
  611: sizes easier to read.  The block size used for display is independent
  612: of any file system block size.  Fractional block counts are rounded up
  613: to the nearest integer.
  614: 
  615:    The default block size is chosen by examining the following
  616: environment variables in turn; the first one that is set determines the
  617: block size.
  618: 
  619: `DF_BLOCK_SIZE'
  620:      This specifies the default block size for the `df' command.
  621:      Similarly, `DU_BLOCK_SIZE' specifies the default for `du' and
  622:      `LS_BLOCK_SIZE' for `ls'.
  623: 
  624: `BLOCK_SIZE'
  625:      This specifies the default block size for all three commands, if
  626:      the above command-specific environment variables are not set.
  627: 
  628: `BLOCKSIZE'
  629:      This specifies the default block size for all values that are
  630:      normally printed as blocks, if neither `BLOCK_SIZE' nor the above
  631:      command-specific environment variables are set.  Unlike the other
  632:      environment variables, `BLOCKSIZE' does not affect values that are
  633:      normally printed as byte counts, e.g., the file sizes contained in
  634:      `ls -l' output.
  635: 
  636: `POSIXLY_CORRECT'
  637:      If neither `COMMAND_BLOCK_SIZE', nor `BLOCK_SIZE', nor `BLOCKSIZE'
  638:      is set, but this variable is set, the block size defaults to 512.
  639: 
  640: 
  641:    If none of the above environment variables are set, the block size
  642: currently defaults to 1024 bytes in most contexts, but this number may
  643: change in the future.  For `ls' file sizes, the block size defaults to
  644: 1 byte.
  645: 
  646:    A block size specification can be a positive integer specifying the
  647: number of bytes per block, or it can be `human-readable' or `si' to
  648: select a human-readable format.  Integers may be followed by suffixes
  649: that are upward compatible with the SI prefixes
  650: (http://www.bipm.fr/enus/3_SI/si-prefixes.html) for decimal multiples
  651: and with the IEC 60027-2 prefixes for binary multiples
  652: (http://physics.nist.gov/cuu/Units/binary.html).
  653: 
  654:    With human-readable formats, output sizes are followed by a size
  655: letter such as `M' for megabytes.  `BLOCK_SIZE=human-readable' uses
  656: powers of 1024; `M' stands for 1,048,576 bytes.  `BLOCK_SIZE=si' is
  657: similar, but uses powers of 1000 and appends `B'; `MB' stands for
  658: 1,000,000 bytes.
  659: 
  660:    A block size specification preceded by `'' causes output sizes to be
  661: displayed with thousands separators.  The `LC_NUMERIC' locale specifies
  662: the thousands separator and grouping.  For example, in an American
  663: English locale, `--block-size="'1kB"' would cause a size of 1234000
  664: bytes to be displayed as `1,234'.  In the default C locale, there is no
  665: thousands separator so a leading `'' has no effect.
  666: 
  667:    An integer block size can be followed by a suffix to specify a
  668: multiple of that size.  A bare size letter, or one followed by `iB',
  669: specifies a multiple using powers of 1024.  A size letter followed by
  670: `B' specifies powers of 1000 instead.  For example, `1M' and `1MiB' are
  671: equivalent to `1048576', whereas `1MB' is equivalent to `1000000'.
  672: 
  673:    A plain suffix without a preceding integer acts as if `1' were
  674: prepended, except that it causes a size indication to be appended to
  675: the output.  For example, `--block-size="kB"' displays 3000 as `3kB'.
  676: 
  677:    The following suffixes are defined.  Large sizes like `1Y' may be
  678: rejected by your computer due to limitations of its arithmetic.
  679: 
  680: `kB'
  681:      kilobyte: 10^3 = 1000.
  682: 
  683: `k'
  684: `K'
  685: `KiB'
  686:      kibibyte: 2^10 = 1024.  `K' is special: the SI prefix is `k' and
  687:      the IEC 60027-2 prefix is `Ki', but tradition and POSIX use `k' to
  688:      mean `KiB'.
  689: 
  690: `MB'
  691:      megabyte: 10^6 = 1,000,000.
  692: 
  693: `M'
  694: `MiB'
  695:      mebibyte: 2^20 = 1,048,576.
  696: 
  697: `GB'
  698:      gigabyte: 10^9 = 1,000,000,000.
  699: 
  700: `G'
  701: `GiB'
  702:      gibibyte: 2^30 = 1,073,741,824.
  703: 
  704: `TB'
  705:      terabyte:  10^12 = 1,000,000,000,000.
  706: 
  707: `T'
  708: `TiB'
  709:      tebibyte: 2^40 = 1,099,511,627,776.
  710: 
  711: `PB'
  712:      petabyte: 10^15 = 1,000,000,000,000,000.
  713: 
  714: `P'