Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

rmdir(1)

unlink(2)

RM(1)  —  UNIX Programmer’s Manual

NAME

rm  − remove (unlink) files

SYNOPSIS

rm [ −f ] [ −i ] [ −r ] [ − ] file ... 

DESCRIPTION

Rm removes the entries for one or more files from a directory.  If an entry was the last (or only) link to the file, the file is destroyed.  Removal of a file requires write permission in its directory, but neither read nor write permission on the file itself is required.  Paradoxically, you can remove a file with rm even though you do not have permission to read or edit it. 

If a file has no write permission and the standard input is a terminal, its permissions are printed and a line is read from the standard input.  If that line begins with ’y’ the file is deleted, otherwise the file remains. 

No questions are asked and no errors are reported when the −f (force) option is given. 

The −i option stands for interactive mode.  The user is prompted by the name of the file.  A response starting with y causes the file to be removed.  Any other response is considered a no. 

If a designated file is a directory, an error comment is printed unless the optional argument −r has been used.  In that case, rm recursively deletes the entire contents of the specified directory, and the directory itself, quickly and efficiently. 

The null option − indicates that all the arguments following it are to be treated as file names.  This allows the specification of file names starting with a minus. 

EXAMPLE

rm -r dirname

will remove the entire contents of the named directory and all subdirectories, and finally the directory itself, with no questions asked. 

SEE ALSO

rmdir(1), unlink(2)

DIAGNOSTICS

Generally self-explanatory.  It is forbidden to remove the file ".." merely to avoid the antisocial consequences of inadvertently doing something like "rm −r .*". 

7th Edition  —  2/5/82

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026