unixdev.net


Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (SunOS-4.1.3)
Page:
Section:
Apropos / Subsearch:
optional field

RM(1)                       General Commands Manual                      RM(1)



NAME
       rm, rmdir - remove (unlink) files or directories

SYNOPSIS
       rm [ - ] [ -fir ] filename...

       rmdir directory...

DESCRIPTION
       rm  removes (directory entries for) one or more files.  If an entry was
       the last link to the file, the contents of that  file  are  lost.   See
       ln(1V) for more information about multiple links to files.

       To  remove a file, you must have write permission in its directory; but
       you do not need read or write permission on the file itself.  If you do
       not  have write permission on the file and the standard input is a ter-
       minal, rm displays the file's permissions and waits for you to type  in
       a response.  If your response begins with y the file is deleted; other-
       wise the file is left alone.

       rmdir removes each named directory.  rmdir only removes empty  directo-
       ries.

OPTIONS
       -      Treat  the  following arguments as filenames `-' so that you can
              specify filenames starting with a minus.

       -f     Force files to be removed without displaying permissions, asking
              questions or reporting errors.

       -i     Ask whether to delete each file, and, under -r, whether to exam-
              ine each directory.  Sometimes called the interactive option.

       -r     Recursively delete the contents of a directory, its  subdirecto-
              ries, and the directory itself.

SEE ALSO
       ln(1V), su(1V)

BUGS
       `rm   -r'  removes  a directory and its files only if your real user ID
       has write permission on that directory.

DIAGNOSTICS
       rm: filename: No such file or directory
              filename does not exist.  rm will also return false (1) if file-
              name was not found.

WARNING
       It is forbidden to remove the file `..'  to avoid the antisocial conse-
       quences of inadvertently doing something like `rm  -r  .*'.



                                12 January 1988                          RM(1)