IPB
>  Man Pages > Unix > Solaris 10 11/06 > Section 1 > rm man page

rm man page

Section 1 - Solaris 10 11/06 Man Pages

Other operating system man pages available here


Advanced Search

Hopefully, this page is exactly what you are looking for, but if not, you can always find further assistance on Unix/Linux Forum!





User Commands                                               rm(1)



NAME
     rm, rmdir - remove directory entries

SYNOPSIS
     /usr/bin/rm [-f] [-i] file...

     /usr/bin/rm -rR [-f] [-i] dirname... [file...]

     /usr/xpg4/bin/rm [-fiRr] file...

     /usr/bin/rmdir [-ps] dirname...

DESCRIPTION
  /usr/bin/rm /usr/xpg4/bin/rm
     The rm utility removes the directory entry specified by each
     file  argument.  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 (for yes), the file is deleted, otherwise the
     file remains.

     If file is a symbolic link, the link will  be  removed,  but
     the  file  or  directory  to  which  it  refers  will not be
     deleted. Users do not need write permission to remove a sym-
     bolic  link,  provided  they  have  write permissions in the
     directory.

     If multiple files are specified and removal of a file  fails
     for  any reason, rm will write a diagnostic message to stan-
     dard error, do nothing more to the current file, and  go  on
     to any remaining files.

     If the standard input is not a terminal,  the  utility  will
     operate as if the -f option is in effect.

  /usr/bin/rmdir
     The rmdir utility will remove the directory entry  specified
     by each dirname operand, which must refer to an empty direc-
     tory.

     Directories will be processed in the order specified.  If  a
     directory and a subdirectory of that directory are specified
     in a single invocation of rmdir, the  subdirectory  must  be
     specified  before  the  parent  directory so that the parent
     directory will be empty when rmdir tries to remove it.

OPTIONS
     The following options  are  supported  for  /usr/bin/rm  and
     /usr/xpg4/bin/rm:





SunOS 5.10          Last change: 26 Jan 2001                    1






User Commands                                               rm(1)



     -r       Recursively removes directories and  subdirectories
              in the argument list. The directory will be emptied
              of files and removed. The user is normally prompted
              for  removal of any write-protected files which the
              directory contains. The write-protected  files  are
              removed  without  prompting,  however,  if  the  -f
              option is used, or if the standard input is  not  a
              terminal and the -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  utility will always
              fail (even if the -f option is used), resulting  in
              an error message.



     -R       Same as -r option.



  /usr/bin/rm
     The following options are supported for /usr/bin/rm only:

     -f       Removes all files (whether write-protected or  not)
              in  a  directory  without  prompting 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.



     -i       Interactive. With this option, rm prompts for  con-
              firmation  before  removing any files. It overrides
              the -f option and remains in  effect  even  if  the
              standard input is not a terminal.



  /usr/xpg4/bin/rm
     The following options  are  supported  for  /usr/xpg4/bin/rm
     only:

     -f       Does not prompt for confirmation.  Does  not  write
              diagnostic  messages  or  modify the exit status in
              the case of  non-existent  operands.  Any  previous
              occurrences of the -i option will be ignored.




SunOS 5.10          Last change: 26 Jan 2001                    2






User Commands                                               rm(1)



     -i       Prompts for confirmation. Any occurrences of the -f
              option will be ignored.



  /usr/bin/rmdir
     The following options are supported for /usr/bin/rmdir only:

     -p       Allows users to remove the  directory  dirname  and
              its  parent  directories which become empty. A mes-
              sage is printed to standard error if all or part of
              the path could not be removed.



     -s       Suppresses the  message  printed  on  the  standard
              error when -p is in effect.



OPERANDS
     The following operands are supported:

     file            A path name  of  a  directory  entry  to  be
                     removed.



     dirname         A path name of  an  empty  directory  to  be
                     removed.



USAGE
     See largefile(5) for the description of the behavior  of  rm
     and rmdir when encountering files greater than or equal to 2
     Gbyte ( 2**31 bytes).

EXAMPLES
     The following examples are valid for the commands shown.

  /usr/bin/rm /usr/xpg4/bin/rm
     Example 1: Removing directories

     The following command:

     example% rm a.out core

     removes the directory entries a.out and core.

     Example 2: Removing a directory without prompting




SunOS 5.10          Last change: 26 Jan 2001                    3






User Commands                                               rm(1)



     The following command:

     example% rm -rf junk

     removes the directory junk and  all  its  contents,  without
     prompting.

  /usr/bin/rmdir
     Example 3: Removing empty directories

     If a directory a in the current directory is  empty,  except
     that it contains a directory b, and a/b is empty except that
     it contains a directory c, the following command will remove
     all three directories:

     example% rmdir -p a/b/c

ENVIRONMENT VARIABLES
     See environ(5) for descriptions of the following environment
     variables  that  affect the execution of rm and rmdir: LANG,
     LC_ALL, LC_COLLATE, LC_CTYPE, LC_MESSAGES, and NLSPATH.

EXIT STATUS
     The following exit values are returned:

     0        If the -f option was not specified, all  the  named
              directory  entries were removed; otherwise, all the
              existing named directory entries were removed.



     >0       An error occurred.



ATTRIBUTES
     See attributes(5) for descriptions of the  following  attri-
     butes:

  /usr/bin/rm /usr/bin/rmdir
     ____________________________________________________________
    |       ATTRIBUTE TYPE        |       ATTRIBUTE VALUE       |
    |_____________________________|_____________________________|
    | Availability                | SUNWcsu                     |
    |_____________________________|_____________________________|
    | CSI                         | enabled                     |
    |_____________________________|_____________________________|


  /usr/xpg4/bin/rm





SunOS 5.10          Last change: 26 Jan 2001                    4






User Commands                                               rm(1)



     ____________________________________________________________
    |       ATTRIBUTE TYPE        |       ATTRIBUTE VALUE       |
    |_____________________________|_____________________________|
    | Availability                | SUNWxcu4                    |
    |_____________________________|_____________________________|
    | CSI                         | enabled                     |
    |_____________________________|_____________________________|
    | Interface Stability         | Standard                    |
    |_____________________________|_____________________________|


SEE ALSO
     rmdir(2),  unlink(2),  attributes(5),   environ(5),   large-
     file(5), standards(5)

DIAGNOSTICS
     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:

     example% rm -r .*

     It is forbidden to remove the file "/" in order to avoid the
     consequences of inadvertently doing something like:

     example% rm -rf $x/$y

     or

     example% rm -rf /$y

     when $x and $y expand to empty strings.

NOTES
     A - permits the user to mark explicitly the end of any  com-
     mand  line  options, allowing rm to recognize file arguments
     that begin with a -. As an aid to  BSD  migration,  rm  will
     accept  -- as a synonym for -. This migration aid may disap-
     pear in a future release. If a -- and a - both appear on the
     same command line, the second will be interpreted as a file.













SunOS 5.10          Last change: 26 Jan 2001                    5





Man(1) output converted with man2html and wrapped by fishsponge

This page was generated on Wed Sep 12 11:25:21 GMT 2007

Your favourite pages:

No pages logged yet.
Trying to save cookie...

Top 10 most popular pages:

sqlite3 man page (5333 hits)
(openSUSE 10.2)

svn man page (5208 hits)
(FreeBSD 6.2)

adv_cap_autoneg man page (4870 hits)
(Solaris 10 11_06)

CPAN man page (4607 hits)
(Suse Linux 10.1)

ssh man page (4342 hits)
(Suse Linux 10.1)

ssh-socks5-proxy-connect man page (2874 hits)
(Solaris 10 11_06)

netcat man page (2717 hits)
(Suse Linux 10.1)

pprosetup man page (2487 hits)
(Solaris 10 11_06)

startproc man page (2471 hits)
(Suse Linux 10.1)

signal man page (2406 hits)
(Suse Linux 10.1)

Useful Links

Go Back

Visitor Statistics


Valid XHTML 1.0 Transitional     Valid CSS!

Partners: Cambridge Plus :: Pyrenees Ski Holidays :: Server Room Temperature Monitor :: <Link Available>
Unix Man Pages / Linux Man Pages :: HiFi Forum :: SIP VoIP Phone & Provider Reviews :: UNIX/Linux Forum Archives

More info on advertising on Unix/Linux Forum