1.\" Copyright (c) 1990 The Regents of the University of California. 2.\" All rights reserved. 3.\" 4.\" %sccs.include.redist.man% 5.\" 6.\" @(#)rm.1 6.7 (Berkeley) 03/14/91 7.\" 8.Vx 9.Dd 10.Dt RM 1 11.Os 12.Sh NAME 13.Nm rm 14.Nd remove directory entries 15.Sh SYNOPSIS 16.Nm rm 17.Op Fl f Li \&| Fl i 18.Op Fl dRr 19.Ar file ... 20.Sh DESCRIPTION 21The 22.Nm rm 23utility attempts to remove the non-directory type files specified on the 24command line. 25If the permissions of the file do not permit writing, and the standard 26input device is a terminal, the user is prompted (on the standard error 27output) for confirmation. 28.Pp 29The options are as follows: 30.Tw 8n 31.Tp Fl d 32Attempt to remove directories as well as other types of files. 33.Tp Fl f 34Attempt to remove the files without prompting for confirmation, 35regardless of the file's permissions. 36If the file does not exist, do not display a diagnostic message or modify 37the exit status to reflect an error. 38The 39.Fl f 40option overrides any previous 41.Fl i 42options. 43.Tp Fl i 44Request confirmation before attempting to remove each file, regardless of 45the file's permissions, or whether or not the standard input device is a 46terminal. 47The 48.Fl i 49option overrides any previous 50.Fl f 51options. 52.Tp Fl R 53Attempt to remove the file hierarchy rooted in each file argument. 54The 55.Fl R 56option implies the 57.Fl d 58option. 59If the 60.Fl i 61option is specified, the user is prompted for confirmation before 62each directory's contents are processed (as well as before the attempt 63is made to remove the directory). 64If the user does not respond affirmatively, the file hierarchy rooted in 65that directory is skipped. 66.Pp 67.Tp Fl r 68Equivalent to 69.Fl R . 70.Tp 71.Pp 72The 73.Nm rm 74utility removes symbolic links, not the files referenced by the links. 75.Pp 76It is an error to attempt to remove the files ``.'' and ``..''. 77.Pp 78The 79.Nm rm 80utility exits 0 if all of the named files or file hierarchies were removed, 81or if the 82.Fl f 83option was specified and all of the existing files or file hierarchies were 84removed. 85If an error occurs, 86.Nm rm 87exits with a value >0. 88.Sh SEE ALSO 89.Xr rmdir 1 , 90.Xr unlink 2 , 91.Xr fts 3 92.Sh COMPATIBILITY 93The 94.Nm rm 95utility differs from historical implementations in that the 96.Fl f 97option only masks attempts to remove non-existent files instead of 98masking a large variety of errors. 99.Pp 100Also, historical BSD implementations prompted on the standard output, 101not the standard error output. 102.Sh STANDARDS 103The 104.Nm rm 105function is expected to be POSIX 1003.2 compatible. 106