Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ rm(1) — OSF/1 1.0 (TIN) MIPS

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ln(1)

rmdir(1)

rmdir(2)

unlink(2)

rm(1)  —  Commands

OSF

NAME

rm − Removes (unlinks) files or directories

SYNOPSIS

rm [-efir] [−] file ... 

The rm command removes the entries for the specified files from a directory. 

FLAGS

-eDisplays a message after deleting each file. 

-fDoes not prompt before removing a file that does not have write permission set, and does not display an error message if a specified file does not exist. 

-iPrompts you before deleting each file (interactive).  When you use both -i and -r, rm also asks if you want to examine directories. 

-rPermits recursive removal of directories and their contents (for cases where file is a directory). 

-Indicates that all arguments following it are to be treated as filenames.  This allows the specification of filenames starting with a − (dash). 

DESCRIPTION

If an entry is the last link to a file, it is destroyed.  To remove a file, you must have write permission for its parent directory, but need neither read nor write permission for the file itself.  If the sticky bit on the directory is set, you must be the owner of the file or superuser. 

If a file has no write permission and standard input is a tty, rm displays the file permission code and reads a line from standard input.  If that line begins with y, or the locale’s equivalent of a y, rm deletes the file.  If the response is anything else, the rm command does nothing to that file and continues with the next specified file. 

The LC_MESSAGES variable determines the locale’s equivalent of y or n (for yes/no queries). 

EXAMPLES

     1.To delete a file, enter:

rm  myfile

If there is another link to this file, then the file remains under that name, but myfile is removed.  If myfile is the only link, the file itself is deleted. 

     2.To delete a file silently, enter:

rm  -f  core

This removes core without asking any questions or displaying any error messages.  This is normally used in shell procedures.  It prevents confusing messages from being displayed when deleting files that may or may not exist. 

     3.To delete files interactively, enter:

rm  -i  mydir/∗

After each filename is displayed, enter the to affirmative response; press <Return> (or anything other than the affirmative response) to retain the file. 

     4.To delete a directory tree interactively, enter:

rm  -ir  manual

This recursively removes the contents of all subdirectories of manual, then removes manual itself, asking if you want to remove each file and directory. 

RELATED INFORMATION

Commands:  ln(1), rmdir(1). 

Functions:  rmdir(2), unlink(2). 

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