


_O_n_l_i_n_e _M_a_n_u_a_l             User Commands                     rm(1)



NNNNAAAAMMMMEEEE
     rm, rmdir - remove files or directories

SSSSYYYYNNNNTTTTAAAAXXXX
     rrrrmmmm [----ffff] [----iiii] _f_i_l_e ...

     rrrrmmmm ----rrrr [----ffff] [----iiii] _d_i_r_n_a_m_e ... [_f_i_l_e ...]

     rrrrmmmmddddiiiirrrr [----pppp] [----ssss] _d_i_r_n_a_m_e ...

DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
     _r_m removes the entries for one or more files from a direc-
     tory.  If a file has no write permission and the standard
     input is a terminal, the full set of permissions (in octal)
     for the file are printed followed by a question mark. This
     is a prompt for confirmation.  If the answer begins with yyyy
     (for yes), the file is deleted, otherwise the file remains.

     If _f_i_l_e is a symbolic link, the link will be removed, but
     the file or directory to which it refers will not be
     deleted. A user does not need write permission on a symbolic
     link to remove it, provided they have write permissions in
     the directory.

     Note that if the standard input is not a terminal, the com-
     mand will operate as if the ----ffff option is in effect.

     Three options apply to _r_m:

     ----ffff   This option causes the removal of all files (whether
          write-protected or not) in a directory without prompt-
          ing the user.  In a write-protected directory, however,
          files are never removed (whatever their permissions
          are), but no messages are displayed. If the removal of
          a write-protected directory is attempted, this option
          will not suppress an error message.

     ----rrrr   This option causes the recursive removal of any direc-
          tories and subdirectories in the argument list.  The
          directory will be emptied of files and removed.  Note
          that the user is normally prompted for removal of any
          write-protected files which the directory contains.
          The write-protected files are removed without prompt-
          ing, however, if the ----ffff option is used, or if the stan-
          dard input is not a terminal and the ----iiii option is not
          used.  Symbolic links that are encountered with this
          option will not be traversed.  If the removal of a
          non-empty, write-protected directory is attempted, the
          command will always fail (even if the ----ffff option is
          used), resulting in an error message.

     ----iiii   With this option, confirmation of removal of any
          write-protected file occurs interactively.  It over-
          rides the ----ffff option and remains in effect even if the
          standard input is not a terminal.

     Two options apply to _r_m_d_i_r:

     ----pppp   This option allows users to remove the directory






          _d_i_r_n_a_m_e and its parent directories which become empty.
          A message is printed on standard output about whether
          the whole path is removed or part of the path remains
          for some reason.

     ----ssss   This option is used to suppress the message printed on
          standard error when ----pppp is in effect.

DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
     All messages are generally self-explanatory.

     It is forbidden to remove the files "...." and "........" in order to
     avoid the consequences of inadvertently doing something like
     the following:

          rrrrmmmm ----rrrr ....****

     Both _r_m and _r_m_d_i_r return exit codes of 0 if all the speci-
     fied directories are removed successfully.  Otherwise, they
     return a non-zero exit code.

SSSSEEEEEEEE AAAALLLLSSSSOOOO
     System Calls (2): rmdir, unlink

NNNNOOOOTTTTEEEESSSS
     A -------- permits the user to mark explicitly the end of any com-
     mand line options, allowing _r_m to recognize filename argu-
     ments that begin with a ----.  If a -------- and a ---- both appear on
     the same command line, the second will be interpreted as a
     filename.

August 1991                                   TX User's Reference




























