logo

utils-std

Collection of commonly available Unix tools git clone https://anongit.hacktivis.me/git/utils-std.git

rm.1 (1379B)


  1. .\" utils-std: Collection of commonly available Unix tools
  2. .\" Copyright 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
  3. .\" SPDX-License-Identifier: MPL-2.0
  4. .Dd 2024-03-20
  5. .Dt RM 1
  6. .Os
  7. .Sh NAME
  8. .Nm rm
  9. .Nd remove files and directories
  10. .Sh SYNOPSIS
  11. .Nm
  12. .Op Fl dfirRv
  13. .Op Ar file...
  14. .Sh DESCRIPTION
  15. The
  16. .Nm
  17. utility removes each given
  18. .Ar file ,
  19. by default directories aren't removed.
  20. .Pp
  21. As required by POSIX,
  22. .Nm
  23. explicitely checks if a file is writable, when not and
  24. .Fl f
  25. wasn't passed, the user is prompted before removal.
  26. Care should be taken when using other programs as
  27. .Xr unlink 2
  28. only fails when the containing directory isn't writable, rather than the file itself.
  29. .Sh OPTIONS
  30. .Bl -tag -width Ds
  31. .It Fl d
  32. Remove empty directories, doesn't empties them first via recursion.
  33. .It Fl f
  34. Force: Never prompt before recursing into directories and removing files, non-existing files do not change exit status nor produce diagnostic messages.
  35. Overrides
  36. .Fl i .
  37. .It Fl i
  38. Interactive: Prompt before removing any file
  39. .It Fl r , Fl R
  40. Recurse into directories, also allowing to remove them.
  41. .It Fl v
  42. Verbose: Print when a file got removed
  43. .El
  44. .Sh EXIT STATUS
  45. .Ex -std
  46. .Sh SEE ALSO
  47. .Xr unlink 2
  48. .Sh STANDARDS
  49. .Nm
  50. should be compliant with the
  51. IEEE Std 1003.1-2024 (“POSIX.1”)
  52. specification.
  53. .Sh AUTHORS
  54. .An Haelwenn (lanodan) Monnier Aq Mt contact+utils@hacktivis.me