rm.1 (1378B)
- .\" utils-std: Collection of commonly available Unix tools
- .\" Copyright 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
- .\" SPDX-License-Identifier: MPL-2.0
- .Dd 2024-03-20
- .Dt RM 1
- .Os
- .Sh NAME
- .Nm rm
- .Nd remove files and directories
- .Sh SYNOPSIS
- .Nm
- .Op Fl dfirRv
- .Op Ar file...
- .Sh DESCRIPTION
- The
- .Nm
- utility removes each given
- .Ar file ,
- by default directories aren't removed.
- .Pp
- As required by POSIX,
- .Nm
- explicitly checks if a file is writable, when not and
- .Fl f
- wasn't passed, the user is prompted before removal.
- Care should be taken when using other programs as
- .Xr unlink 2
- only fails when the containing directory isn't writable, rather than the file itself.
- .Sh OPTIONS
- .Bl -tag -width Ds
- .It Fl d
- Remove empty directories, doesn't empties them first via recursion.
- .It Fl f
- Force: Never prompt before recursing into directories and removing files, non-existing files do not change exit status nor produce diagnostic messages.
- Overrides
- .Fl i .
- .It Fl i
- Interactive: Prompt before removing any file
- .It Fl r , Fl R
- Recurse into directories, also allowing to remove them.
- .It Fl v
- Verbose: Print when a file got removed
- .El
- .Sh EXIT STATUS
- .Ex -std
- .Sh SEE ALSO
- .Xr unlink 2
- .Sh STANDARDS
- .Nm
- should be compliant with the
- IEEE Std 1003.1-2024 (“POSIX.1”)
- specification.
- .Sh AUTHORS
- .An Haelwenn (lanodan) Monnier Aq Mt contact+utils@hacktivis.me