Rm (Unix)

rm
Original author(s)Ken Thompson, Dennis Ritchie
(AT&T Bell Laboratories)
Developer(s)Various open-source and commercial developers
Initial releaseNovember 3, 1971 (1971-11-03)
Written inC
Operating systemUnix, Unix-like, V, Plan 9, Inferno, KolibriOS, IBM i
PlatformCross-platform
TypeCommand
Licensecoreutils: GPLv3+
Plan 9: MIT License

rm, short for remove, is a shell command on Unix and Unix-like operating systems used to remove files (which includes special files such as directories) from the file system.

The rm command may not actually delete a file since it only removes a reference to a file via the unlink() system call. A file can have multiple references (for example, a file with two names). The file will remain on the file system if there are other references to it after the specified links are removed.

The command generally does not destroy (overwrite/clear) file data, since its purpose to merely unlink() references, and the filesystem space freed may still contain leftover data from the removed file. This can be a security concern in some cases, and hardened versions sometimes provide for wiping out the data as the last link is being cut, and programs such as shred and srm are available which specifically provide data wiping capability.

Since rm does not provide a fallback to recover a file such as a recycle bin, its use involves the risk of accidentally losing information.[1] Users tend to wrap calls to rm 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.

The command is available in Windows via UnxUtils,[2] KolibriOS,[3] IBM i,[4] and EFI shell.[5]

The unlink command provides a similar function. The del command provides a similar capability in MS-DOS, OS/2, and Windows.

  1. ^ "Unix - Frequently Asked Questions (3/7) [Frequent posting]Section - How do I "undelete" a file?". www.faqs.org.
  2. ^ "Native Win32 ports of some GNU utilities". unxutils.sourceforge.net.
  3. ^ "Shell - KolibriOS wiki". wiki.kolibrios.org.
  4. ^ IBM. "IBM System i Version 7.2 Programming Qshell" (PDF). IBM. Retrieved 2020-09-05.
  5. ^ "EFI Shells and Scripting". Intel. Retrieved 2013-09-25.

© MMXXIII Rich X Search. We shall prevail. All rights reserved. Rich X Search