Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Rm (Unix)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Shell command for deleting files}} {{lowercase title}} {{Infobox software | name = rm | logo = | screenshot = Rm --help Command - Unix.png | screenshot size = | caption = The {{code|rm}} command | author = [[Ken Thompson]], [[Dennis Ritchie]]<br />([[AT&T Bell Laboratories]]) | developer = Various [[open-source software|open-source]] and [[commercial software|commercial]] developers | released = {{Start date and age|1971|11|3}} | latest release version = | latest release date = | programming language = [[C (programming language)|C]] | operating system = [[Unix]], [[Unix-like]], [[V (operating system)|V]], [[Plan 9 from Bell Labs|Plan 9]], [[Inferno (operating system)|Inferno]], [[KolibriOS]], [[IBM i]] | platform = [[Cross-platform]] | genre = [[Command (computing)|Command]] | license = [[coreutils]]: [[GPLv3+]]<br />Plan 9: [[MIT License]] | website = }} '''<code>rm</code>''', short for '''r'''e'''m'''ove, is a [[shell (computing)|shell]] [[command (computing)|command]] for removing files (which includes [[Unix file type|special files]] such as [[directory (computing)|directories]]) from the [[file system]]. The command may not actually delete a file (release its storage for reuse) since it only unlinks it {{endash}} removes a [[hard link]] to a file via the <code>[[unlink (Unix)|unlink()]]</code> [[system call]]. If a file has multiple links and less than all are removed, then the file remains in the file system; accessible via its other links. When a file's only link is removed, then the file is deleted {{endash}} releasing its storage space for other use. Generally, a deleted file's former storage space still contains the file's data until it is overwritten with another file's content. The data is not accessible via normal file operations but can be recovered via specialized tools. Since this is considered a [[software security|security]] risk in some contexts, a hardened version of {{code|cp}} may wipe the file's storage area when the file is deleted. Commands such as [[Shred (Unix)|shred]] and [[srm (Unix)|srm]] specifically provide data wiping. Since <code>rm</code> does not provide a fallback to recover a file such as a [[recycle bin (computing)|recycle bin]], its use involves the risk of accidentally losing information.<ref>{{Cite web|url=http://www.faqs.org/faqs/unix-faq/faq/part3/section-6.html|title=Unix - Frequently Asked Questions (3/7) [Frequent posting]Section - How do I "undelete" a file?|website=www.faqs.org}}</ref> Users tend to wrap calls to <code>rm</code> in safety mechanisms to limit accidental deletion. There are [[undelete]] utilities that attempts to reconstruct the index and can bring the file back if its storage was not reused. Originally, developed for [[Unix]], today it is also available on [[Unix-like]] and non Unix-like systems, [[KolibriOS]],<ref>{{Cite web|url=http://wiki.kolibrios.org/wiki/Shell|title=Shell - KolibriOS wiki|website=wiki.kolibrios.org}}</ref> [[IBM i]],<ref>{{cite web |title=IBM System i Version 7.2 Programming Qshell |language=en |author=IBM |website=[[IBM]] |author-link=IBM |url=https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_74/rzahz/rzahzpdf.pdf?view=kc |access-date=2020-09-05 }}</ref> [[Unified Extensible Firmware Interface|EFI shell]].<ref name="EFI-Shells-and-Scripting">{{cite web | url = http://software.intel.com/en-us/articles/efi-shells-and-scripting/ | title = EFI Shells and Scripting | publisher = [[Intel]] | access-date = 2013-09-25 }}</ref> and [[Windows]] (via [[UnxUtils]]).<ref>{{Cite web|url=http://unxutils.sourceforge.net/|title=Native Win32 ports of some GNU utilities|website=unxutils.sourceforge.net}}</ref> The <code>[[Del (command)|del]]</code> command provides a similar capability in [[MS-DOS]], [[OS/2]], and [[Command Prompt]]. Like {{code|rm}}, the <code>[[unlink (Unix)|unlink]]</code> command also removes (unlinks) files, but only one file at a time.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)