rm

Remove files or directories.

Install

All systems
curl cmd.cat/rm.sh
Debian Debian
apt-get install coreutils
Ubuntu
apt-get install coreutils
Alpine
apk add coreutils
Arch Arch Linux
pacman -S coreutils
image/svg+xml Kali Linux
apt-get install coreutils
CentOS
yum install coreutils
Fedora
dnf install coreutils
OS X
brew install coreutils
Raspbian
apt-get install coreutils

Remove files or directories.

  • Remove files from arbitrary locations:
    rm path/to/file path/to/another/file
  • Recursively remove a directory and all its subdirectories:
    rm -r path/to/folder
  • Forcibly remove a directory, without prompting for confirmation or showing error messages:
    rm -rf path/to/folder
  • Interactively remove multiple files, with a prompt before every removal:
    rm -i file(s)
  • Remove files in verbose mode, printing a message for each removed file:
    rm -v path/to/folder/*

© tl;dr; authors and contributors