![]() The rm command | |
Original author(s) | Ken Thompson, Dennis Ritchie (AT&T Bell Laboratories) |
---|---|
Developer(s) | Various open-source and commercial developers |
Initial release | November 3, 1971 |
Written in | C |
Operating system | Unix, Unix-like, V, Plan 9, Inferno, KolibriOS, IBM i |
Platform | Cross-platform |
Type | Command |
License | coreutils: 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.
© MMXXIII Rich X Search. We shall prevail. All rights reserved. Rich X Search