Home

Rm

Rm, usually written as rm, is a standard command in Unix and Unix-like operating systems used to delete files and directories from the filesystem. It is typically found as /bin/rm or /usr/bin/rm and is provided by implementations such as GNU coreutils on Linux, BSD utilities on BSD systems, and equivalent programs on other platforms.

Rm deletes files by issuing the appropriate system calls (such as unlink) and removes directories with directory-specific

Caution is a central concern with rm because deletions are typically permanent and bypass standard trash or

History and variants: rm originated in early Unix as part of the core set of filesystem utilities.

See also: unlink, rmdir, trash or recycle utilities, and shell file-management commands.

operations
(such
as
rmdir)
depending
on
the
options
given.
Common
options
include
-r
or
-R
for
recursive
removal
of
directories,
-d
for
removing
empty
directories,
-f
to
ignore
non-existent
files
and
suppress
prompts,
-i
to
prompt
before
each
removal,
and
-v
to
print
what
is
being
removed.
GNU
coreutils
versions
also
offer
--preserve-root
to
prevent
deleting
the
root
directory
and
other
safety-oriented
options.
recycle
mechanisms.
Recursive
and
forced
removals
can
rapidly
erase
large
portions
of
a
filesystem
if
misused,
especially
when
combined
with
wildcards.
Some
environments
apply
default
aliases
(for
example,
alias
rm='rm
-i')
to
reduce
risk,
while
others
expose
the
full,
unadorned
command.
Users
should
carefully
verify
targets
and
paths
before
execution,
and
consider
using
interactive
or
safer
workflows
when
handling
important
data.
Today,
it
is
most
commonly
implemented
as
a
GNU
coreutils
program
on
Linux,
with
BSD,
macOS,
and
other
systems
providing
compatible
versions.
Different
environments
may
vary
slightly
in
available
options
and
behavior,
but
the
core
purpose
remains
the
same:
to
remove
files
and,
with
appropriate
options,
to
remove
directories
and
their
contents.