RM(1)

okay bestie, welcome to the General Commands Manual, the rm page, and yes this is the one that can end your whole career if you're not paying attention 🫢 be so fr right now, we're reading it together.


✨ NAME ✨

rm β€” Remove (unlink) the FILE(s) πŸ’…

🌸 SYNOPSIS 🌸

rm [OPTION]... FILE...

πŸ¦‹ DESCRIPTION πŸ¦‹

Remove (unlink) the FILE(s). that's it. that's the whole job description, and yet it's the most powerful little thing in your terminal, no cap πŸ’€


πŸŽ€ OPTIONS πŸŽ€

so many little switches, so much power, let's get into it bestie:

  • -f, --force β€” ignore files and args that don't even exist, and never prompt. it just goes. iconic, kinda scary 🫣
  • -i β€” prompt before every single removal. yes, every one. she asks permission each time, respectful queen ✨
  • -I β€” prompt once before removing more than three files, or whenever it's removing recursively. less intrusive than -i, but still giving you some protection against most mistakes. lowkey the sweet spot πŸ₯°
  • --interactive[=<WHEN>] β€” prompt according to WHEN: never, once (that's -I), or always (that's -i). if you don't give a WHEN at all, it prompts always. Possible values:
    • always
    • once
    • never
  • --one-file-system β€” when removing a hierarchy recursively, skip any directory that lives on a file system different from the one of the corresponding command line argument. (NOT IMPLEMENTED) so like, it's here, it's listed, it does not do the thing. noted πŸ’€
  • --no-preserve-root β€” do NOT treat / specially. bestie. BESTIE. why. 😭
  • --preserve-root[=<all>] β€” do not remove / (this is the default btw, thank god); with all, reject any command line argument that's on a separate device from its parent. Possible values:
    • all
  • -r, --recursive β€” remove directories and all their contents, recursively, all the way down, the whole tree πŸŒ³βœ‚οΈ
  • -d, --dir β€” remove empty directories. only empty ones, she's picky πŸ’…
  • -v, --verbose β€” explain what is being done. she narrates her own slay 🎀
  • -g, --progress β€” display a progress bar. note: this feature is not supported by GNU coreutils. πŸ“
  • -h, --help β€” print help 🫢
  • -V, --version β€” print version πŸ‘‘
  • [files] β€” the files, bestie. the ones getting unlinked.

🌈 EXTRA 🌈

By default, rm does not remove directories. you gotta use the --recursive (-r or -R) option to remove each listed directory too, along with all of its contents. no vibes-based exceptions, that's just the rule ✨

To remove a file whose name starts with a -, for example -foo, use one of these commands:

rm -- -foo
rm ./-foo
Note that if you use rm to remove a file, it might be possible to recover some of its contents, given sufficient expertise and/or time. For greater assurance that the contents are truly unrecoverable, consider using shred. 🫣 so like, deletion is not always forever, iykyk

⭐ VERSION ⭐

v(uutils coreutils) 0.12.0


πŸ’œ EXAMPLES πŸ’œ

Remove specific files:

rm path/to/file1 path/to/file2 ...

Remove specific files ignoring nonexistent ones:

rm [-f|--force] path/to/file1 path/to/file2 ...

Remove specific files interactively prompting before each removal:

rm [-i|--interactive] path/to/file1 path/to/file2 ...

Remove specific files printing info about each removal:

rm [-v|--verbose] path/to/file1 path/to/file2 ...

Remove specific files and directories recursively:

rm [-r|--recursive] path/to/file_or_directory1
path/to/file_or_directory2 ...

Remove empty directories (this is considered the safe method):

rm [-d|--dir] path/to/directory

The examples are provided by the tldr-pages project <https://tldr.sh> under the CC BY 4.0 License. Please note that, as uutils is a work in progress, some examples might fail. 🧚


okay and that's the whole page bestie, mwah πŸ’– also real quick, the classic manpage console is General Commands Manual, and this version is stamped 2026-09-25 and comes from uutils coreutils β€” so go forth, be careful with that /, and remember: with great -r comes great responsibility πŸŒΈπŸ‘‘πŸ’…

πŸ“¦ where this page comes from