143084Scael.\" Copyright (c) 1990 The Regents of the University of California. 243084Scael.\" All rights reserved. 319282Smckusick.\" 4*50204Sbostic.\" This code is derived from software contributed to Berkeley by 5*50204Sbostic.\" the Institute of Electrical and Electronics Engineers, Inc. 6*50204Sbostic.\" 743084Scael.\" %sccs.include.redist.man% 819282Smckusick.\" 9*50204Sbostic.\" @(#)rm.1 6.8 (Berkeley) 06/27/91 1043084Scael.\" 1147426Scael.Vx 1243084Scael.Dd 1343084Scael.Dt RM 1 1447426Scael.Os 1543084Scael.Sh NAME 1643084Scael.Nm rm 1743084Scael.Nd remove directory entries 1843084Scael.Sh SYNOPSIS 1943084Scael.Nm rm 2043084Scael.Op Fl f Li \&| Fl i 2145769Sbostic.Op Fl dRr 2243084Scael.Ar file ... 2343084Scael.Sh DESCRIPTION 2445769SbosticThe 2545769Sbostic.Nm rm 2645769Sbosticutility attempts to remove the non-directory type files specified on the 2745769Sbosticcommand line. 2845769SbosticIf the permissions of the file do not permit writing, and the standard 2947195Sbosticinput device is a terminal, the user is prompted (on the standard error 3047195Sbosticoutput) for confirmation. 3143084Scael.Pp 3247195SbosticThe options are as follows: 3344957Scael.Tw 8n 3445769Sbostic.Tp Fl d 3545769SbosticAttempt to remove directories as well as other types of files. 3643084Scael.Tp Fl f 3745769SbosticAttempt to remove the files without prompting for confirmation, 3845769Sbosticregardless of the file's permissions. 3945769SbosticIf the file does not exist, do not display a diagnostic message or modify 4045769Sbosticthe exit status to reflect an error. 4145769SbosticThe 4245769Sbostic.Fl f 4345769Sbosticoption overrides any previous 4445769Sbostic.Fl i 4545769Sbosticoptions. 4643084Scael.Tp Fl i 4745769SbosticRequest confirmation before attempting to remove each file, regardless of 4845769Sbosticthe file's permissions, or whether or not the standard input device is a 4945769Sbosticterminal. 5045769SbosticThe 5145769Sbostic.Fl i 5245769Sbosticoption overrides any previous 5345769Sbostic.Fl f 5445769Sbosticoptions. 5543084Scael.Tp Fl R 5645769SbosticAttempt to remove the file hierarchy rooted in each file argument. 5745769SbosticThe 5845769Sbostic.Fl R 5945769Sbosticoption implies the 6045769Sbostic.Fl d 6145769Sbosticoption. 6245769SbosticIf the 6345769Sbostic.Fl i 6445769Sbosticoption is specified, the user is prompted for confirmation before 6545769Sbosticeach directory's contents are processed (as well as before the attempt 6645769Sbosticis made to remove the directory). 6745769SbosticIf the user does not respond affirmatively, the file hierarchy rooted in 6845769Sbosticthat directory is skipped. 6943084Scael.Pp 7043084Scael.Tp Fl r 7143084ScaelEquivalent to 7244957Scael.Fl R . 7343084Scael.Tp 7443084Scael.Pp 7543084ScaelThe 7643084Scael.Nm rm 7745769Sbosticutility removes symbolic links, not the files referenced by the links. 7845769Sbostic.Pp 7945769SbosticIt is an error to attempt to remove the files ``.'' and ``..''. 8045769Sbostic.Pp 8145769SbosticThe 8245769Sbostic.Nm rm 8347195Sbosticutility exits 0 if all of the named files or file hierarchies were removed, 8447195Sbosticor if the 8545769Sbostic.Fl f 8647195Sbosticoption was specified and all of the existing files or file hierarchies were 8747195Sbosticremoved. 8847195SbosticIf an error occurs, 8947195Sbostic.Nm rm 9047195Sbosticexits with a value >0. 9143084Scael.Sh SEE ALSO 9245769Sbostic.Xr rmdir 1 , 9345769Sbostic.Xr unlink 2 , 9445769Sbostic.Xr fts 3 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 10347195SbosticAlso, historical BSD implementations prompted on the standard output, 10447195Sbosticnot the standard error output. 10543084Scael.Sh STANDARDS 10643084ScaelThe 10743084Scael.Nm rm 10843084Scaelfunction is expected to be POSIX 1003.2 compatible. 109