Concept

Rm (Unix)

Summary
rm (short for remove) is a basic command on Unix and Unix-like operating systems used to remove objects such as s, directories and symbolic links from s and also such as device nodes, pipes and sockets, similar to the del command in MS-DOS, OS/2, and Microsoft Windows. The command is also available in the EFI shell. The rm command removes references to objects from the filesystem using the unlink system call, where those objects might have had multiple references (for example, a file with two different names), and the objects themselves are discarded only when all references have been removed and no programs still have open handles to the objects. This allows for scenarios where a program can open a file, immediately remove it from the filesystem, and then use it for temporary space, knowing that the file's space will be reclaimed after the program exits, even if it exits by crashing. The command generally does not destroy file data, since its purpose is really merely to 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. rm is generally only seen on UNIX-derived operating systems, which typically do not provide for recovery of deleted files through a mechanism like the recycle bin, hence the tendency for users to enclose rm in some kind of wrapper to limit accidental file deletion. There are undelete utilities that will attempt to reconstruct the index and can bring the file back if the parts were not reused. On some old versions of Unix, the rm command would delete directories if they were empty. This behaviour can still be obtained in some versions of rm with the -d flag, e.g., the BSDs (such as FreeBSD, NetBSD, OpenBSD and macOS) derived from 4.4BSD-Lite2. The version of rm bundled in GNU coreutils was written by Paul Rubin, David MacKenzie, Richard Stallman, and Jim Meyering.
About this result
This page is automatically generated and may contain information that is not correct, complete, up-to-date, or relevant to your search query. The same applies to every other page on this website. Please make sure to verify the information with EPFL's official sources.