Changeset View
Changeset View
Standalone View
Standalone View
head/bin/rm/rm.1
Show All 26 Lines | |||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" @(#)rm.1 8.5 (Berkeley) 12/5/94 | .\" @(#)rm.1 8.5 (Berkeley) 12/5/94 | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd November 7, 2015 | .Dd September 12, 2018 | ||||
.Dt RM 1 | .Dt RM 1 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm rm , | .Nm rm , | ||||
.Nm unlink | .Nm unlink | ||||
.Nd remove directory entries | .Nd remove directory entries | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.Nm | .Nm | ||||
.Op Fl f | i | .Op Fl f | i | ||||
.Op Fl dIPRrvWx | .Op Fl dIPRrvWx | ||||
.Ar | .Ar | ||||
.Nm unlink | .Nm unlink | ||||
.Op Fl - | |||||
.Ar file | .Ar file | ||||
.Sh DESCRIPTION | .Sh DESCRIPTION | ||||
The | The | ||||
.Nm | .Nm | ||||
utility attempts to remove the non-directory type files specified on the | utility attempts to remove the non-directory type files specified on the | ||||
command line. | command line. | ||||
If the permissions of the file do not permit writing, and the standard | If the permissions of the file do not permit writing, and the standard | ||||
input device is a terminal, the user is prompted (on the standard error | input device is a terminal, the user is prompted (on the standard error | ||||
▲ Show 20 Lines • Show All 93 Lines • ▼ Show 20 Lines | |||||
.Nm unlink , | .Nm unlink , | ||||
only one argument, | only one argument, | ||||
which must not be a directory, | which must not be a directory, | ||||
may be supplied. | may be supplied. | ||||
No options may be supplied in this simple mode of operation, | No options may be supplied in this simple mode of operation, | ||||
which performs an | which performs an | ||||
.Xr unlink 2 | .Xr unlink 2 | ||||
operation on the passed argument. | operation on the passed argument. | ||||
However, the usual option-end delimiter, | |||||
.Fl - , | |||||
may optionally precede the argument. | |||||
.Sh EXIT STATUS | .Sh EXIT STATUS | ||||
The | The | ||||
.Nm | .Nm | ||||
utility exits 0 if all of the named files or file hierarchies were removed, | utility exits 0 if all of the named files or file hierarchies were removed, | ||||
or if the | or if the | ||||
.Fl f | .Fl f | ||||
option was specified and all of the existing files or file hierarchies were | option was specified and all of the existing files or file hierarchies were | ||||
removed. | removed. | ||||
Show All 31 Lines | |||||
the file will be overwritten and removed even if it has hard links. | the file will be overwritten and removed even if it has hard links. | ||||
.Sh EXAMPLES | .Sh EXAMPLES | ||||
Recursively remove all files contained within the | Recursively remove all files contained within the | ||||
.Pa foobar | .Pa foobar | ||||
directory hierarchy: | directory hierarchy: | ||||
.Pp | .Pp | ||||
.Dl $ rm -rf foobar | .Dl $ rm -rf foobar | ||||
.Pp | .Pp | ||||
Either of these commands will remove the file | Any of these commands will remove the file | ||||
.Pa -f : | .Pa -f : | ||||
.Bd -literal -offset indent | .Bd -literal -offset indent | ||||
$ rm -- -f | $ rm -- -f | ||||
$ rm ./-f | $ rm ./-f | ||||
$ unlink -f | |||||
.Ed | .Ed | ||||
.Sh COMPATIBILITY | .Sh COMPATIBILITY | ||||
The | The | ||||
.Nm | .Nm | ||||
utility differs from historical implementations in that the | utility differs from historical implementations in that the | ||||
.Fl f | .Fl f | ||||
option only masks attempts to remove non-existent files instead of | option only masks attempts to remove non-existent files instead of | ||||
masking a large variety of errors. | masking a large variety of errors. | ||||
▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines |