xref: /csrg-svn/bin/rm/rm.1 (revision 55730)
143084Scael.\" Copyright (c) 1990 The Regents of the University of California.
243084Scael.\" All rights reserved.
319282Smckusick.\"
450204Sbostic.\" This code is derived from software contributed to Berkeley by
550204Sbostic.\" the Institute of Electrical and Electronics Engineers, Inc.
650204Sbostic.\"
750625Scael.\" %sccs.include.redist.roff%
819282Smckusick.\"
9*55730Sbostic.\"	@(#)rm.1	6.11 (Berkeley) 07/27/92
1043084Scael.\"
1143084Scael.Dd
1243084Scael.Dt RM 1
1347426Scael.Os
1443084Scael.Sh NAME
1543084Scael.Nm rm
1643084Scael.Nd remove directory entries
1743084Scael.Sh SYNOPSIS
1843084Scael.Nm rm
1950625Scael.Op Fl f | Fl i
2045769Sbostic.Op Fl dRr
2143084Scael.Ar file ...
2243084Scael.Sh DESCRIPTION
2345769SbosticThe
2445769Sbostic.Nm rm
2545769Sbosticutility attempts to remove the non-directory type files specified on the
2645769Sbosticcommand line.
2745769SbosticIf the permissions of the file do not permit writing, and the standard
2847195Sbosticinput device is a terminal, the user is prompted (on the standard error
2947195Sbosticoutput) for confirmation.
3043084Scael.Pp
3147195SbosticThe options are as follows:
3250625Scael.Bl -tag -width flag
3350625Scael.It Fl d
3445769SbosticAttempt to remove directories as well as other types of files.
3550625Scael.It Fl f
3645769SbosticAttempt to remove the files without prompting for confirmation,
3745769Sbosticregardless of the file's permissions.
3845769SbosticIf the file does not exist, do not display a diagnostic message or modify
3945769Sbosticthe exit status to reflect an error.
4045769SbosticThe
4145769Sbostic.Fl f
4245769Sbosticoption overrides any previous
4345769Sbostic.Fl i
4445769Sbosticoptions.
4550625Scael.It Fl i
4645769SbosticRequest confirmation before attempting to remove each file, regardless of
4745769Sbosticthe file's permissions, or whether or not the standard input device is a
4845769Sbosticterminal.
4945769SbosticThe
5045769Sbostic.Fl i
5145769Sbosticoption overrides any previous
5245769Sbostic.Fl f
5345769Sbosticoptions.
5450625Scael.It Fl R
5545769SbosticAttempt to remove the file hierarchy rooted in each file argument.
5645769SbosticThe
5745769Sbostic.Fl R
5845769Sbosticoption implies the
5945769Sbostic.Fl d
6045769Sbosticoption.
6145769SbosticIf the
6245769Sbostic.Fl i
6345769Sbosticoption is specified, the user is prompted for confirmation before
6445769Sbosticeach directory's contents are processed (as well as before the attempt
6545769Sbosticis made to remove the directory).
6645769SbosticIf the user does not respond affirmatively, the file hierarchy rooted in
6745769Sbosticthat directory is skipped.
6843084Scael.Pp
6950625Scael.It Fl r
7043084ScaelEquivalent to
7144957Scael.Fl R .
7250625Scael.El
7343084Scael.Pp
7443084ScaelThe
7543084Scael.Nm rm
7645769Sbosticutility removes symbolic links, not the files referenced by the links.
7745769Sbostic.Pp
7845769SbosticIt is an error to attempt to remove the files ``.'' and ``..''.
7945769Sbostic.Pp
8045769SbosticThe
8145769Sbostic.Nm rm
8247195Sbosticutility exits 0 if all of the named files or file hierarchies were removed,
8347195Sbosticor if the
8445769Sbostic.Fl f
8547195Sbosticoption was specified and all of the existing files or file hierarchies were
8647195Sbosticremoved.
8747195SbosticIf an error occurs,
8847195Sbostic.Nm rm
8947195Sbosticexits with a value >0.
9043084Scael.Sh SEE ALSO
9145769Sbostic.Xr rmdir 1 ,
9245769Sbostic.Xr unlink 2 ,
93*55730Sbostic.Xr fts 3 ,
94*55730Sbostic.Xr symlink 7
9547195Sbostic.Sh COMPATIBILITY
9647195SbosticThe
9747195Sbostic.Nm rm
9847195Sbosticutility differs from historical implementations in that the
9947195Sbostic.Fl f
10047195Sbosticoption only masks attempts to remove non-existent files instead of
10147195Sbosticmasking a large variety of errors.
10247195Sbostic.Pp
10350625ScaelAlso, historical
10450625Scael.Bx
10550625Scaelimplementations prompted on the standard output,
10647195Sbosticnot the standard error output.
10743084Scael.Sh STANDARDS
10843084ScaelThe
10943084Scael.Nm rm
11050625Scaelcommand is expected to be
11150625Scael.St -p1003.2
11250625Scaelcompatible.
113