home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / fileutils-3.13-bin.lha / info / fileutils.info-2 (.txt) < prev    next >
GNU Info File  |  1996-10-12  |  41KB  |  830 lines

  1. This is Info file fileutils.info, produced by Makeinfo-1.64 from the
  2. input file /ade-src/fsf/fileutils/doc/fileutils.texi.
  3. START-INFO-DIR-ENTRY
  4. * File utilities: (fileutils).  GNU file utilities.
  5. * chgrp: (fileutils)chgrp invocation.           Change file groups.
  6. * chown: (fileutils)chown invocation.           Change file owners/groups.
  7. * chmod: (fileutils)chmod invocation.           Change file permissions.
  8. * cp: (fileutils)cp invocation.                 Copy files.
  9. * dd: (fileutils)dd invocation.                 Copy and convert a file.
  10. * df: (fileutils)df invocation.                 Report filesystem disk usage.
  11. * dir: (fileutils)dir invocation.               List directories briefly.
  12. * dircolors: (fileutils)dircolors invocation.   Color setup for ls.
  13. * du: (fileutils)du invocation.                 Report on disk usage.
  14. * install: (fileutils)install invocation.       Copy and change attributes.
  15. * ln: (fileutils)ln invocation.                 Make links between files.
  16. * ls: (fileutils)ls invocation.                 List directory contents.
  17. * mkdir: (fileutils)mkdir invocation.           Create directories.
  18. * mkfifo: (fileutils)mkfifo invocation.         Create FIFOs: (named pipes).
  19. * mknod: (fileutils)mknod invocation.           Create special files.
  20. * mv: (fileutils)mv invocation.                 Rename files.
  21. * rm: (fileutils)rm invocation.                 Remove files.
  22. * rmdir: (fileutils)rmdir invocation.           Remove empty directories.
  23. * sync: (fileutils)sync invocation.             Synchronize memory and disk.
  24. * touch: (fileutils)touch invocation.           Change file timestamps.
  25. * vdir: (fileutils)vdir invocation.             List directories verbosely.
  26. END-INFO-DIR-ENTRY
  27.    This file documents the GNU set of file utilities.
  28.    Copyright (C) 1994, 95, 96 Free Software Foundation, Inc.
  29.    Permission is granted to make and distribute verbatim copies of this
  30. manual provided the copyright notice and this permission notice are
  31. preserved on all copies.
  32.    Permission is granted to copy and distribute modified versions of
  33. this manual under the conditions for verbatim copying, provided that
  34. the entire resulting derived work is distributed under the terms of a
  35. permission notice identical to this one.
  36.    Permission is granted to copy and distribute translations of this
  37. manual into another language, under the above conditions for modified
  38. versions, except that this permission notice may be stated in a
  39. translation approved by the Foundation.
  40. File: fileutils.info,  Node: cp invocation,  Next: dd invocation,  Up: Basic operations
  41. `cp': Copy files and directories
  42. ================================
  43.    `cp' copies files (or, optionally, directories).  The copy is
  44. completely independent of the original.  You can either copy one file to
  45. another, or copy arbitrarily many files to a destination directory.
  46. Synopsis:
  47.      cp [OPTION]... SOURCE DEST
  48.      cp [OPTION]... SOURCE... DIRECTORY
  49.    If the last argument names an existing directory, `cp' copies each
  50. SOURCE file into that directory (retaining the same name).  Otherwise,
  51. if only two files are given, it copies the first onto the second.  It
  52. is an error if the last argument is not a directory and more than two
  53. non-option arguments are given.
  54.    Generally, files are written just as they are read.  For exceptions,
  55. see the `--sparse' option below.
  56.    By default, `cp' does not copy directories (see `-r' below).
  57.    `cp' generally refuses to copy a file onto itself, with the
  58. following exception: if `--force --backup' is specified with SOURCE and
  59. DEST identical, and referring to a regular file, `cp' will make a
  60. backup file, either regular or numbered, as specified in the usual ways
  61. (*note Backup options::.).  This is useful when you simply want to make
  62. a backup of an existing file before changing it.
  63.    The program accepts the following options.  Also see *Note Common
  64. options::.
  65. `--archive'
  66.      Preserve as much as possible of the structure and attributes of the
  67.      original files in the copy (but do not preserve directory
  68.      structure).  Equivalent to `-dpR'.
  69. `--backup'
  70.      Make backups of files that are about to be overwritten or removed.
  71.      *Note Backup options::.
  72. `--no-dereference'
  73.      Copy symbolic links as symbolic links rather than copying the
  74.      files that they point to, and preserve hard links between source
  75.      files in the copies.
  76. `--force'
  77.      Remove existing destination files.
  78. `--interactive'
  79.      Prompt whether to overwrite existing regular destination files.
  80. `--link'
  81.      Make hard links instead of copies of non-directories.
  82. `--preserve'
  83.      Preserve the original files' owner, group, permissions, and
  84.      timestamps.
  85. `--parents'
  86.      Form the name of each destination file by appending to the target
  87.      directory a slash and the specified name of the source file.  The
  88.      last argument given to `cp' must be the name of an existing
  89.      directory.  For example, the command:
  90.           cp --parents a/b/c existing_dir
  91.      copies the file `a/b/c' to `existing_dir/a/b/c', creating any
  92.      missing intermediate directories.
  93.      Copy directories recursively, copying any non-directories and
  94.      non-symbolic links (that is, FIFOs and special files) as if they
  95.      were regular files.  This means trying to read the data in each
  96.      source file and writing it to the destination.  Thus, with this
  97.      option, `cp' may well hang indefinitely reading a FIFO, unless
  98.      something else happens to be writing it.
  99. `--recursive'
  100.      Copy directories recursively, preserving non-directories (see `-r'
  101.      just above).
  102. `--sparse=WHEN'
  103.      A "sparse file" contains "holes"--a sequence of zero bytes that
  104.      does not occupy any physical disk blocks; the `read' system call
  105.      reads these as zeroes.  This can both save considerable disk space
  106.      and increase speed, since many binary files contain lots of
  107.      consecutive zero bytes.  By default, `cp' detects holes in input
  108.      source files via a crude heuristic and makes the corresponding
  109.      output file sparse as well.
  110.      The WHEN value can be one of the following:
  111.     `auto'
  112.           The default behavior: the output file is sparse if the input
  113.           file is sparse.
  114.     `always'
  115.           Always make the output file sparse.  This is useful when the
  116.           input file resides on a filesystem that does not support
  117.           sparse files (the most notable example is `efs' filesystems
  118.           in SGI IRIX 5.3 and earlier), but the output file is on
  119.           another type of filesystem.
  120.     `never'
  121.           Never make the output file sparse.  If you find an
  122.           application for this option, let us know.
  123. `--symbolic-link'
  124.      Make symbolic links instead of copies of non-directories.  All
  125.      source file names must be absolute (starting with `/') unless the
  126.      destination files are in the current directory.  This option merely
  127.      results in an error message on systems that do not support
  128.      symbolic links.
  129. `-S SUFFIX'
  130. `--suffix=SUFFIX'
  131.      Append SUFFIX to each backup file made with `-b'.  *Note Backup
  132.      options::.
  133. `--update'
  134.      Do not copy a nondirectory that has an existing destination with
  135.      the same or newer modification time.
  136. `--verbose'
  137.      Print the name of each file before copying it.
  138. `-V METHOD'
  139. `--version-control=METHOD'
  140.      Change the type of backups made with `-b'.  The METHOD argument
  141.      can be `numbered' (or `t'), `existing' (or `nil'), or `never' (or
  142.      `simple').  *Note Backup options::.
  143. `--one-file-system'
  144.      Skip subdirectories that are on different filesystems from the one
  145.      that the copy started on.
  146. File: fileutils.info,  Node: dd invocation,  Next: install invocation,  Prev: cp invocation,  Up: Basic operations
  147. `dd': Convert and copy a file
  148. =============================
  149.    `dd' copies a file (from standard input to standard output, by
  150. default) with a changeable I/O blocksize, while optionally performing
  151. conversions on it.  Synopsis:
  152.      dd [OPTION]...
  153.    The program accepts the following options.  Also see *Note Common
  154. options::.
  155.    The numeric-valued options below (BYTES and BLOCKS) can be followed
  156. by a multiplier: `b'=512, `c'=1, `k'=1024, `w'=2, `xM'=M.
  157. `if=FILE'
  158.      Read from FILE instead of standard input.
  159. `of=FILE'
  160.      Write to FILE instead of standard output.  Unless `conv=notrunc'
  161.      is given, `dd' truncates FILE to zero bytes (or the size specified
  162.      with `seek=').
  163. `ibs=BYTES'
  164.      Read BYTES bytes at a time.
  165. `obs=BYTES'
  166.      Write BYTES bytes at a time.
  167. `bs=BYTES'
  168.      Both read and write BYTES bytes at a time.  This overrides `ibs'
  169.      and `obs'.
  170. `cbs=BYTES'
  171.      Convert BYTES bytes at a time.
  172. `skip=BLOCKS'
  173.      Skip BLOCKS `ibs'-byte blocks in the input file before copying.
  174. `seek=BLOCKS'
  175.      Skip BLOCKS `obs'-byte blocks in the output file before copying.
  176. `count=BLOCKS'
  177.      Copy BLOCKS `obs'-byte blocks from the input file, instead of
  178.      everything until the end of the file.
  179. `conv=CONVERSION[,CONVERSION]...'
  180.      Convert the file as specified by the CONVERSION argument(s).  (No
  181.      spaces around any comma(s).)
  182.      Conversions:
  183.     `ascii'
  184.           Convert EBCDIC to ASCII.
  185.     `ebcdic'
  186.           Convert ASCII to EBCDIC.
  187.     `ibm'
  188.           Convert ASCII to alternate EBCDIC.
  189.     `block'
  190.           For each line in the input, output `cbs' bytes, replacing the
  191.           input newline with a space and padding with spaces as
  192.           necessary.
  193.     `unblock'
  194.           Replace trailing spaces in each `cbs'-sized input block with a
  195.           newline.
  196.     `lcase'
  197.           Change uppercase letters to lowercase.
  198.     `ucase'
  199.           Change lowercase letters to uppercase.
  200.     `swab'
  201.           Swap every pair of input bytes.  GNU `dd', unlike others,
  202.           works when an odd number of bytes are read--the last byte is
  203.           simply copied (since there is nothing to swap it with).
  204.     `noerror'
  205.           Continue after read errors.
  206.     `notrunc'
  207.           Do not truncate the output file.
  208.     `sync'
  209.           Pad every input block to size of `ibs' with trailing zero
  210.           bytes.
  211. File: fileutils.info,  Node: install invocation,  Next: mv invocation,  Prev: dd invocation,  Up: Basic operations
  212. `install': Copy files and set attributes
  213. ========================================
  214.    `install' copies files while setting their permission modes and, if
  215. possible, their owner and group.  Synopses:
  216.      install [OPTION]... SOURCE DEST
  217.      install [OPTION]... SOURCE... DIRECTORY
  218.      install -d [OPTION]... DIRECTORY...
  219.    In the first of these, the SOURCE file is copied to the DEST target
  220. file.  In the second, each of the SOURCE files are copied to the
  221. destination DIRECTORY.  In the last, each DIRECTORY (and any missing
  222. parent directories) is created.
  223.    `install' is similar to `cp', but allows you to control the
  224. attributes of destination files.  It is typically used in Makefiles to
  225. copy programs into their destination directories.  It refuses to copy
  226. files onto themselves.
  227.    The program accepts the following options.  Also see *Note Common
  228. options::.
  229. `--backup'
  230.      Make backups of files that are about to be overwritten or removed.
  231.      *Note Backup options::.
  232.      Ignored; for compatibility with old Unix versions of `install'.
  233. `--directory'
  234.      Create each given directory and any missing parent directories,
  235.      setting the owner, group and mode as given on the command line or
  236.      to the defaults.  It also gives any parent directories it creates
  237.      those attributes.  (This is different from the SunOS 4.x
  238.      `install', which gives directories that it creates the default
  239.      attributes.)
  240. `-g GROUP'
  241. `--group=GROUP'
  242.      Set the group ownership of installed files or directories to
  243.      GROUP. The default is the process's current group.  GROUP may be
  244.      either a group name or a numeric group id.
  245. `-m MODE'
  246. `--mode=MODE'
  247.      Set the permissions for the installed file or directory to MODE,
  248.      which can be either an octal number, or a symbolic mode as in
  249.      `chmod', with 0 as the point of departure (*note File
  250.      permissions::.).  The default mode is 0755--read, write, and
  251.      execute for the owner, and read and execute for group and other.
  252. `-o OWNER'
  253. `--owner=OWNER'
  254.      If `install' has appropriate privileges (is run as root), set the
  255.      ownership of installed files or directories to OWNER. The default
  256.      is `root'.  OWNER may be either a user name or a numeric user ID.
  257. `-l LOGFILE'
  258. `--log=LOGILE'
  259.      Create a log file with name, size and date of all installed files.
  260.      LOGFILE should be a path like /var/install-logs/fileutils-3.13.
  261. `--strip'
  262.      Strip the symbol tables from installed binary executables.
  263. `-S SUFFIX'
  264. `--suffix=SUFFIX'
  265.      Append SUFFIX to each backup file made with `-b'.  *Note Backup
  266.      options::.
  267. `-V METHOD'
  268. `--version-control=METHOD'
  269.      Change the type of backups made with `-b'.  The METHOD argument
  270.      can be `numbered' (or `t'), `existing' (or `nil'), or `never' (or
  271.      `simple').  *Note Backup options::.
  272. File: fileutils.info,  Node: mv invocation,  Next: rm invocation,  Prev: install invocation,  Up: Basic operations
  273. `mv': Move (rename) files
  274. =========================
  275.    `mv' moves or renames files (or directories).  Synopsis:
  276.      mv [OPTION]... SOURCE DEST
  277.      mv [OPTION]... SOURCE... DIRECTORY
  278.    If the last argument names an existing directory, `mv' moves each
  279. other given file into a file with the same name in that directory.
  280. Otherwise, if only two files are given, it renames the first as the
  281. second.  It is an error if the last argument is not a directory and
  282. more than two files are given.
  283.    `mv' can move only regular files across filesystems.
  284.    If a destination file exists but is normally unwritable, standard
  285. input is a terminal, and the `-f' or `--force' option is not given,
  286. `mv' prompts the user for whether to replace the file.  (You might own
  287. the file, or have write permission on its directory.)  If the response
  288. does not begin with `y' or `Y', the file is skipped.
  289.    The program accepts the following options.  Also see *Note Common
  290. options::.
  291. `--backup'
  292.      Make backups of files that are about to be overwritten or removed.
  293.      *Note Backup options::.
  294. `--force'
  295.      Remove existing destination files and never prompt the user.
  296. `--interactive'
  297.      Prompt whether to overwrite each existing destination file,
  298.      regardless of its permissions.  If the response does not begin
  299.      with `y' or `Y', the file is skipped.
  300. `--update'
  301.      Do not move a nondirectory that has an existing destination with
  302.      the same or newer modification time.
  303. `--verbose'
  304.      Print the name of each file before moving it.
  305. `-S SUFFIX'
  306. `--suffix=SUFFIX'
  307.      Append SUFFIX to each backup file made with `-b'.  *Note Backup
  308.      options::.
  309. `-V METHOD'
  310. `--version-control=METHOD'
  311.      Change the type of backups made with `-b'.  The METHOD argument
  312.      can be `numbered' (or `t'), `existing' (or `nil'), or `never' (or
  313.      `simple').  *Note Backup options::.
  314. File: fileutils.info,  Node: rm invocation,  Prev: mv invocation,  Up: Basic operations
  315. `rm': Remove files or directories
  316. =================================
  317.    `rm' removes each given FILE.  By default, it does not remove
  318. directories.  Synopsis:
  319.      rm [OPTION]... [FILE]...
  320.    If a file is unwritable, standard input is a terminal, and the `-f'
  321. or `--force' option is not given, or the `-i' or `--interactive' option
  322. *is* given, `rm' prompts the user for whether to remove the file.  If
  323. the response does not begin with `y' or `Y', the file is skipped.
  324.    The program accepts the following options.  Also see *Note Common
  325. options::.
  326. `--directory'
  327.      Remove directories with `unlink' instead of `rmdir', and don't
  328.      require a directory to be empty before trying to unlink it.  Only
  329.      works if you have appropriate privileges.  Because unlinking a
  330.      directory causes any files in the deleted directory to become
  331.      unreferenced, it is wise to `fsck' the filesystem after doing this.
  332. `--force'
  333.      Ignore nonexistent files and never prompt the user.
  334. `--interactive'
  335.      Prompt whether to remove each file.  If the response does not begin
  336.      with `y' or `Y', the file is skipped.
  337. `--recursive'
  338.      Remove the contents of directories recursively.
  339. `--verbose'
  340.      Print the name of each file before removing it.
  341.    One common question is how to remove files whose names being with a
  342. `-'.  GNU `rm', like every program that uses the `getopt' function to
  343. parse its arguments, lets you use the `--' option to indicate that all
  344. following arguments are non-options.  To remove a file called `-f' in
  345. the current directory, you could type either:
  346.      rm -- -f
  347.      rm ./-f
  348.    The Unix `rm' program's use of a single `-' for this purpose
  349. predates the development of the getopt standard syntax.
  350. File: fileutils.info,  Node: Special file types,  Next: Changing file attributes,  Prev: Basic operations,  Up: Top
  351. Special file types
  352. ******************
  353.    This chapter describes commands which create special types of files
  354. (and `rmdir', which removes directories, one special file type).
  355.    Although Unix-like operating systems have markedly fewer special file
  356. types than others, not *everything* can be treated only as the
  357. undifferentiated byte stream of "normal files".  For example, when a
  358. file is created or removed, the system must record this information,
  359. which it does in a "directory"--a special type of file.  Although you
  360. can read directories as normal files, if you're curious, in order for
  361. the system to do its job it must impose a structure, a certain order,
  362. on the bytes of the file.  Thus it is a "special" type of file.
  363.    Besides directories, other special file types include named pipes
  364. (FIFOs), symbolic links, sockets, and so-called "special files".
  365. * Menu:
  366. * ln invocation::               Make links between files.
  367. * mkdir invocation::            Make directories.
  368. * mkfifo invocation::           Make FIFOs (named pipes).
  369. * mknod invocation::            Make block or character special files.
  370. * rmdir invocation::            Remove empty directories.
  371. File: fileutils.info,  Node: ln invocation,  Next: mkdir invocation,  Up: Special file types
  372. `ln': Make links between files
  373. ==============================
  374.    `ln' makes links between files.  By default, it makes hard links;
  375. with the `-s' option, it makes symbolic (or "soft") links.  Synopses:
  376.      ln [OPTION]... SOURCE [DEST]
  377.      ln [OPTION]... SOURCE... DIRECTORY
  378.    If the last argument names an existing directory, `ln' links each
  379. SOURCE file into a file with the same name in that directory.  (But see
  380. the description of the `--no-dereference' option below.) If only one
  381. file is given, it links that file into the current directory.
  382. Otherwise, if only two files are given, it links the first onto the
  383. second.  It is an error if the last argument is not a directory and more
  384. than two files are given.  By default, it does not remove existing
  385. files.
  386.    A "hard link" is another name for an existing file; the link and the
  387. original are indistinguishable.  (Technically speaking, they share the
  388. same inode, and the inode contains all the information about a
  389. file--indeed, it is not incorrect to say that the inode *is* the file.)
  390. On all existing implementations, you cannot make a hard links to
  391. directories, and hard links cannot cross filesystem boundaries.  (These
  392. restrictions are not mandated by POSIX, however.)
  393.    "Symbolic links" ("symlinks" for short), on the other hand, are a
  394. special file type (which not all kernels support; in particular, system
  395. V release 3 (and older) systems lack symlinks) in which the link file
  396. actually refers to a different file, by name.  When most operations
  397. (opening, reading, writing, and so on) are passed the symbolic link
  398. file, the kernel automatically "dereferences" the link and operates on
  399. the target of the link.  But some operations (e.g., removing) work on
  400. the link file itself, rather than on its target.  *Note Symbolic Links:
  401. (library)Symbolic Links.
  402.    The program accepts the following options.  Also see *Note Common
  403. options::.
  404. `--backup'
  405.      Make backups of files that are about to be overwritten or removed.
  406.      *Note Backup options::.
  407. `--directory'
  408.      Allow the super-user to make hard links to directories.
  409. `--force'
  410.      Remove existing destination files.
  411. `--interactive'
  412.      Prompt whether to remove existing destination files.
  413. `--no-dereference'
  414.      When given an explicit destination that is a symlink to a
  415.      directory, treat that destination as if it were a normal file.
  416.      When the destination is an actual directory (not a symlink to one),
  417.      there is no ambiguity.  The link is created in that directory.
  418.      But when the specified destination is a symlink to a directory,
  419.      there are two ways to treat the user's request.  `ln' can treat
  420.      the destination just as it would a normal directory and create the
  421.      link in it.  On the other hand, the destination can be viewed as a
  422.      non-directory--as the symlink itself.  In that case, `ln' must
  423.      delete or backup that symlink before creating the new link.  The
  424.      default is to treat a destination that is a symlink to a directory
  425.      just like a directory.
  426. `--symbolic'
  427.      Make symbolic links instead of hard links.  This option merely
  428.      produces an error message on systems that do not support symbolic
  429.      links.
  430. `--verbose'
  431.      Print the name of each file before linking it.
  432. `-S SUFFIX'
  433. `--suffix=SUFFIX'
  434.      Append SUFFIX to each backup file made with `-b'.  *Note Backup
  435.      options::.
  436. `-V METHOD'
  437. `--version-control=METHOD'
  438.      Change the type of backups made with `-b'.  The METHOD argument
  439.      can be `numbered' (or `t'), `existing' (or `nil'), or `never' (or
  440.      `simple').  *Note Backup options::.
  441. File: fileutils.info,  Node: mkdir invocation,  Next: mkfifo invocation,  Prev: ln invocation,  Up: Special file types
  442. `mkdir': Make directories
  443. =========================
  444.    `mkdir' creates directories with the specified names.  Synopsis:
  445.      mkdir [OPTION]... NAME...
  446.    It is not an error if a NAME is already a directory; `mkdir' simply
  447. proceeds.  But if a NAME is an existing file and is anything but a
  448. directory, `mkdir' complains.
  449.    The program accepts the following options.  Also see *Note Common
  450. options::.
  451. `-m MODE'
  452. `--mode=MODE'
  453.      Set the mode of created directories to MODE, which is symbolic as
  454.      in `chmod' and uses 0777 (read, write and execute allowed for
  455.      everyone) minus the bits set in the umask for the point of the
  456.      departure.  *Note File permissions::.
  457. `--parents'
  458.      Make any missing parent directories for each argument.  The mode
  459.      for parent directories is set to the umask modified by `u+wx'.
  460.      Ignore arguments corresponding to existing directories.
  461. `--verbose'
  462.      Print a message for each created directory.  This is most useful
  463.      with `--parents'.
  464. File: fileutils.info,  Node: mkfifo invocation,  Next: mknod invocation,  Prev: mkdir invocation,  Up: Special file types
  465. `mkfifo': Make FIFOs (named pipes)
  466. ==================================
  467.    `mkfifo' creates FIFOs (also called "named pipes") with the
  468. specified names.  Synopsis:
  469.      mkfifo [OPTION] NAME...
  470.    A "FIFO" is a special file type that permits independent processes
  471. to communicate.  One process opens the FIFO file for writing, and
  472. another for reading, after which data can flow as with the usual
  473. anonymous pipe in shells or elsewhere.
  474.    The program accepts the following option.  Also see *Note Common
  475. options::.
  476. `-m MODE'
  477. `--mode=MODE'
  478.      Set the mode of created FIFOs to MODE, which is symbolic as in
  479.      `chmod' and uses 0666 (read and write allowed for everyone) minus
  480.      the bits set in the umask for the point of departure.  *Note File
  481.      permissions::.
  482. File: fileutils.info,  Node: mknod invocation,  Next: rmdir invocation,  Prev: mkfifo invocation,  Up: Special file types
  483. `mknod': Make block or character special files
  484. ==============================================
  485.    `mknod' creates a FIFO, character special file, or block special
  486. file with the specified name.  Synopsis:
  487.      mknod [OPTION]... NAME TYPE [MAJOR MINOR]
  488.    Unlike the phrase "special file type" above, the term "special file"
  489. has a technical meaning on Unix: something that can generate or receive
  490. data.  Usually this corresponds to a physical piece of hardware, e.g.,
  491. a printer or a disk.  (These files are typically created at
  492. system-configuration time.)  The `mknod' command is what creates files
  493. of this type.  Such devices can be read either a character at a time or
  494. a "block" (many characters) at a time, hence we say there are "block
  495. special" files and "character special" files.
  496.    The arguments after NAME specify the type of file to make:
  497.      for a FIFO
  498.      for a block (buffered) special file
  499.      for a character (buffered) special file
  500.      for a character (unbuffered) special file
  501.    When making a block or character special file, the major and minor
  502. device numbers must be given after the file type.
  503.    The program accepts the following option.  Also see *Note Common
  504. options::.
  505. `-m MODE'
  506. `--mode=MODE'
  507.      Set the mode of created files to MODE, which is symbolic as in
  508.      `chmod' and uses 0666 minus the bits set in the umask as the point
  509.      of departure.  *Note File permissions::.
  510. File: fileutils.info,  Node: rmdir invocation,  Prev: mknod invocation,  Up: Special file types
  511. `rmdir': Remove empty directories
  512. =================================
  513.    `rmdir' removes empty directories.  Synopsis:
  514.      rmdir [OPTION]... DIRECTORY...
  515.    If any DIRECTORY argument does not refer to an existing empty
  516. directory, it is an error.
  517.    The program accepts the following option.  Also see *Note Common
  518. options::.
  519. `--parents'
  520.      Remove any parent directories that become empty after an argument
  521.      DIRECTORY is removed.
  522.    *Note rm invocation::, for how to remove non-empty directories
  523. (recursively).
  524. File: fileutils.info,  Node: Changing file attributes,  Next: Disk usage,  Prev: Special file types,  Up: Top
  525. Changing file attributes
  526. ************************
  527.    A file is not merely its contents, a name, and a file type (*note
  528. Special file types::.).  A file also has an owner (a userid), a group
  529. (a group id), permissions (what the owner can do with the file, what
  530. people in the group can do, and what everyone else can do), various
  531. timestamps, and other information.  Collectively, we call these a file's
  532. "attributes".
  533.    These commands change file attributes.
  534. * Menu:
  535. * chown invocation::            Change file owners and groups.
  536. * chgrp invocation::            Change file groups.
  537. * chmod invocation::            Change access permissions.
  538. * touch invocation::            Change file timestamps.
  539. File: fileutils.info,  Node: chown invocation,  Next: chgrp invocation,  Up: Changing file attributes
  540. `chown': Change file owner and group
  541. ====================================
  542.    `chown' changes the user and/or group ownership of each given file.
  543. Synopsis:
  544.      chown [OPTION]... NEW-OWNER FILE...
  545.    The first non-option argument, NEW-OWNER, specifies the new owner
  546. and/or group, as follows (with no embedded white space):
  547.      [OWNER] [ [:.] [GROUP] ]
  548.    Specifically:
  549. OWNER
  550.      If only an OWNER (a user name or numeric user id) is given, that
  551.      user is made the owner of each given file, and the files' group is
  552.      not changed.
  553. OWNER`.'GROUP
  554. OWNER`:'GROUP
  555.      If the OWNER is followed by a colon or dot and a GROUP (a group
  556.      name or numeric group id), with no spaces between them, the group
  557.      ownership of the files is changed as well (to GROUP).
  558. OWNER`.'
  559. OWNER`:'
  560.      If a colon or dot but no group name follows OWNER, that user is
  561.      made the owner of the files and the group of the files is changed
  562.      to OWNER's login group.
  563. `.'GROUP
  564. `:'GROUP
  565.      If the colon or dot and following GROUP are given, but the owner
  566.      is omitted, only the group of the files is changed; in this case,
  567.      `chown' performs the same function as `chgrp'.
  568.    The program accepts the following options.  Also see *Note Common
  569. options::.
  570. `--changes'
  571.      Verbosely describe the action for each FILE whose ownership
  572.      actually changes.
  573. `--silent'
  574. `--quiet'
  575.      Do not print error messages about files whose ownership cannot be
  576.      changed.
  577. `--no-dereference'
  578.      Act on symbolic links themselves instead of what they point to.
  579.      Only available if the `lchown' system call is provided.
  580. `--verbose'
  581.      Verbosely describe the action (or non-action) taken for every FILE.
  582. `--recursive'
  583.      Recursively change ownership of directories and their contents.
  584. File: fileutils.info,  Node: chgrp invocation,  Next: chmod invocation,  Prev: chown invocation,  Up: Changing file attributes
  585. `chgrp': Change group ownership
  586. ===============================
  587.    `chgrp' changes the group ownership of each given FILE to GROUP,
  588. which can be either a group name or a numeric group id.  Synopsis:
  589.      chgrp [OPTION]... GROUP FILE...
  590.    The program accepts the following options.  Also see *Note Common
  591. options::.
  592. `--changes'
  593.      Verbosely describe the action for each FILE whose group actually
  594.      changes.
  595. `--silent'
  596. `--quiet'
  597.      Do not print error messages about files whose group cannot be
  598.      changed.
  599. `--no-dereference'
  600.      Act on symbolic links themselves instead of what they point to.
  601.      Only available if the `lchown' system call is provided.
  602. `--verbose'
  603.      Verbosely describe the action or non-action taken for every FILE.
  604. `--recursive'
  605.      Recursively change the group ownership of directories and their
  606.      contents.
  607. File: fileutils.info,  Node: chmod invocation,  Next: touch invocation,  Prev: chgrp invocation,  Up: Changing file attributes
  608. `chmod': Change access permissions
  609. ==================================
  610.    `chmod' changes the access permissions of the named files.  Synopsis:
  611.      chmod [OPTION]... MODE FILE...
  612.    `chmod' never changes the permissions of symbolic links, since the
  613. `chmod' system call cannot change their permissions.  This is not a
  614. problem since the permissions of symbolic links are never used.
  615. However, for each symbolic link listed on the command line, `chmod'
  616. changes the permissions of the pointed-to file.  In contrast, `chmod'
  617. ignores symbolic links encountered during recursive directory
  618. traversals.
  619.    The first non-option argument, MODE, specifies the new permissions.
  620. See the section below for details.
  621.    The program accepts the following options.  Also see *Note Common
  622. options::.
  623. `--changes'
  624.      Verbosely describe the action for each FILE whose permissions
  625.      actually changes.
  626. `--silent'
  627. `--quiet'
  628.      Do not print error messages about files whose permissions cannot be
  629.      changed.
  630. `--verbose'
  631.      Verbosely describe the action or non-action taken for every FILE.
  632. `--recursive'
  633.      Recursively change permissions of directories and their contents.
  634. File: fileutils.info,  Node: touch invocation,  Prev: chmod invocation,  Up: Changing file attributes
  635. `touch': Change file timestamps
  636. ===============================
  637.    `touch' changes the access and/or modification times of the
  638. specified files.  Synopsis:
  639.      touch [OPTION]... FILE...
  640.    If the first FILE would be a valid argument to the `-t' option and
  641. no timestamp is given with any of the `-d', `-r', or `-t' options and
  642. the `--' argument is not given, that argument is interpreted as the
  643. time for the other files instead of as a file name.
  644.    Any FILE that does not exist is created empty.
  645.    If changing both the access and modification times to the current
  646. time, `touch' can change the timestamps for files that the user running
  647. it does not own but has write permission for.  Otherwise, the user must
  648. own the files.
  649.    The program accepts the following options.  Also see *Note Common
  650. options::.
  651. `--time=atime'
  652. `--time=access'
  653. `--time=use'
  654.      Change the access time only.
  655. `--no-create'
  656.      Do not create files that do not exist.
  657. `--date=time'
  658.      Use TIME instead of the current time.  It can contain month names,
  659.      timezones, `am' and `pm', etc.  *Note Date input formats::.
  660.      Ignored; for compatibility with BSD versions of `touch'.
  661. `--time=mtime'
  662. `--time=modify'
  663.      Change the modification time only.
  664. `-r FILE'
  665. `--reference=FILE'
  666.      Use the times of the reference FILE instead of the current time.
  667. `-t MMDDhhmm[[CC]YY][.ss]'
  668.      Use the argument (months, days, hours, minutes, optional century
  669.      and years, optional seconds) instead of the current time.
  670. File: fileutils.info,  Node: Disk usage,  Next: Index,  Prev: Changing file attributes,  Up: Top
  671. Disk usage
  672. **********
  673.    No disk can hold an infinite amount of data.  These commands report
  674. on how much disk storage is in use or available.  (This has nothing
  675. much to do with how much *main memory*, i.e., RAM, a program is using
  676. when it runs; for that, you want `ps' or `pstat' or `swap' or some such
  677. command.)
  678. * Menu:
  679. * df invocation::               Report filesystem disk space usage.
  680. * du invocation::               Estimate file space usage.
  681. * sync invocation::             Synchronize memory and disk.
  682. File: fileutils.info,  Node: df invocation,  Next: du invocation,  Up: Disk usage
  683. `df': Report filesystem disk space usage
  684. ========================================
  685.    `df' reports the amount of disk space used and available on
  686. filesystems.  Synopsis:
  687.      df [OPTION]... [FILE]...
  688.    With no arguments, `df' reports the space used and available on all
  689. currently mounted filesystems (of all types).  Otherwise, `df' reports
  690. on the filesystem containing each argument FILE.
  691.    Disk space is shown in 1024-byte blocks by default, unless the
  692. environment variable `POSIXLY_CORRECT' is set, in which case 512-byte
  693. blocks are used (unless the `-k' option is given).
  694.    If an argument FILE is a disk device file containing a mounted
  695. filesystem, `df' shows the space available on that filesystem rather
  696. than on the filesystem containing the device node (i.e., the root
  697. filesystem).  GNU `df' does not attempt to determine the disk usage on
  698. unmounted filesystems, because on most kinds of systems doing so
  699. requires extremely nonportable intimate knowledge of filesystem
  700. structures.
  701.    The program accepts the following options.  Also see *Note Common
  702. options::.
  703. `--all'
  704.      Include in the listing filesystems that have a size of 0 blocks,
  705.      which are omitted by default.  Such filesystems are typically
  706.      special-purpose pseudo-filesystems, such as automounter entries.
  707.      Also, filesystems of type "ignore" or "auto", supported by some
  708.      operating systems, are only included if this option is specified.
  709. `--human-readable'
  710.      Append a size letter such as `M' for megabytes to each size.
  711. `--inodes'
  712.      List inode usage information instead of block usage.  An inode
  713.      (short for index node) is contains information about a file such
  714.      as its owner, permissions, timestamps, and location on the disk.
  715. `--kilobytes'
  716.      Print sizes in 1024-byte blocks.  This overrides the environment
  717.      variable `POSIXLY_CORRECT'.
  718. `--megabytes'
  719.      Print sizes in megabyte (that 1,048,576 bytes) blocks.
  720. `--no-sync'
  721.      Do not invoke the `sync' system call before getting any usage data.
  722.      This may make `df' run significantly faster on systems with many
  723.      disks, but on some systems (notably SunOS) the results may be
  724.      slightly out of date.  This is the default.
  725. `--portability'
  726.      Use the POSIX output format.  This is like the default format
  727.      except that the information about each filesystem is always
  728.      printed on exactly one line; a mount device is never put on a line
  729.      by itself.  This means that if the mount device name is more than
  730.      20 characters long (e.g., for some network mounts), the columns
  731.      are misaligned.
  732. `--sync'
  733.      Invoke the `sync' system call before getting any usage data.  On
  734.      some systems (notably SunOS), doing this yields more up to date
  735.      results, but in general this option makes `df' much slower,
  736.      especially when there are many or very busy filesystems.
  737. `-t FSTYPE'
  738. `--type=FSTYPE'
  739.      Limit the listing to filesystems of type FSTYPE.  Multiple
  740.      filesystem types can be specified by giving multiple `-t' options.
  741.      By default, nothing is omitted.
  742. `--print-type'
  743.      Print each filesystem's type.  The types printed here are the same
  744.      ones you can include or exclude with `-t' and `-x'.  The particular
  745.      types printed are whatever is supported by the system.  Here are
  746.      some of the common names (this list is certainly not exhaustive):
  747.     `nfs'
  748.           An NFS filesystem, i.e., one mounted over a network from
  749.           another machine.  This is the one type name which seems to be
  750.           used uniformly by all systems.
  751.     `4.2, ufs, efs...'
  752.           A filesystem on a locally-mounted hard disk.  (The system
  753.           might even support more than one type here; Linux does.)
  754.     `hsfs, cdfs'
  755.           A filesystem on a CD-ROM drive.  HP-UX uses `cdfs', most other
  756.           systems use `hsfs' (`hs' for `High Sierra').
  757.     `pcfs'
  758.           An MS-DOS filesystem, usually on a diskette.
  759. `-x FSTYPE'
  760. `--exclude-type=FSTYPE'
  761.      Limit the listing to filesystems not of type FSTYPE.  Multiple
  762.      filesystem types can be eliminated by giving multiple `-x'
  763.      options.  By default, no filesystem types are omitted.
  764.      Ignored; for compatibility with System V versions of `df'.
  765. File: fileutils.info,  Node: du invocation,  Next: sync invocation,  Prev: df invocation,  Up: Disk usage
  766. `du': Estimate file space usage
  767. ===============================
  768.    `du' reports the amount of disk space used by the specified files
  769. and for each subdirectory (of directory arguments).  Synopsis:
  770.      du [OPTION]... [FILE]...
  771.    With no arguments, `du' reports the disk space for the current
  772. directory.  The output is in 1024-byte units by default, unless the
  773. environment variable `POSIXLY_CORRECT' is set, in which case 512-byte
  774. blocks are used (unless `-k' is specified).
  775.    The program accepts the following options.  Also see *Note Common
  776. options::.
  777. `--all'
  778.      Show counts for all files, not just directories.
  779. `--bytes'
  780.      Print sizes in bytes, instead of kilobytes.
  781. `--total'
  782.      Print a grand total of all arguments after all arguments have been
  783.      processed.  This can be used to find out the total disk usage of a
  784.      given set of files or directories.
  785. `--dereference-args'
  786.      Dereference symbolic links that are command line arguments.  Does
  787.      not affect other symbolic links.  This is helpful for finding out
  788.      the disk usage of directories, such as `/usr/tmp', which are often
  789.      symbolic links.
  790. `--human-readable'
  791.      Append a size letter, such as `M' for megabytes, to each size.
  792. `--kilobytes'
  793.      Print sizes in kilobytes.  This overrides the environment variable
  794.      `POSIXLY_CORRECT'.
  795. `--count-links'
  796.      Count the size of all files, even if they have appeared already
  797.      (as a hard link).
  798. `--dereference'
  799.      Dereference symbolic links (show the disk space used by the file
  800.      or directory that the link points to instead of the space used by
  801.      the link).
  802. `--megabytes'
  803.      Print sizes in megabyte (that 1,048,576 bytes) blocks.
  804. `--summarize'
  805.      Display only a total for each argument.
  806. `--separate-dirs'
  807.      Report the size of each directory separately, not including the
  808.      sizes of subdirectories.
  809. `--one-file-system'
  810.      Skip directories that are on different filesystems from the one
  811.      that the argument being processed is on.
  812.    On BSD systems, `du' reports sizes that are half the correct values
  813. for files that are NFS-mounted from HP-UX systems.  On HP-UX systems,
  814. it reports sizes that are twice the correct values for files that are
  815. NFS-mounted from BSD systems.  This is due to a flaw in HP-UX; it also
  816. affects the HP-UX `du' program.
  817. File: fileutils.info,  Node: sync invocation,  Prev: du invocation,  Up: Disk usage
  818. `sync': Synchronize data on disk with memory
  819. ============================================
  820.    `sync' writes any data buffered in memory out to disk.  This can
  821. include (but is not limited to) modified superblocks, modified inodes,
  822. and delayed reads and writes.  This must be implemented by the kernel;
  823. The `sync' program does nothing but exercise the `sync' system call.
  824.    The kernel keeps data in memory to avoid doing (relatively slow) disk
  825. reads and writes.  This improves performance, but if the computer
  826. crashes, data may be lost or the filesystem corrupted as a result.
  827. `sync' ensures everything in memory is written to disk.
  828.    Any arguments are ignored, except for a lone `--help' or `--version'
  829. (*note Common options::.).
  830.