Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ rm(1) — HP-UX 7.01

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

stat(2)

unlink(2)

acl(5)

RM(1)

NAME

rm, rmdir  − remove files or directories

SYNOPSIS

rm [−fri] file ... 
rmdir [−fi] dir ... 

DESCRIPTION

Rm removes the entries for one or more files from a directory.  If an entry was the last 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. 

If a user has no write permission and the standard input is a terminal, its permissions are printed and a line is read from the standard input (see Access Control Lists below).  If that line begins with y the file is deleted; otherwise, the file remains.  No questions are asked when the −f option is given or if the standard input is not a terminal. 

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. 

If the −i (interactive) option is in effect, rm and rmdir ask whether to delete each file or directory.  If −r is specified with −i, rm asks whether to examine each directory before interactively removing files. 

Rmdir removes entries for the named directories, which must be empty. 

Access Control Lists (ACLs).

If a file has optional ACL entries, rm displays a plus sign (+) after the file’s permissions.  The permissions shown summarize the file’s st_mode value returned by stat(2). See also acl(5).

DIAGNOSTICS

Generally self-explanatory.  It is forbidden to remove the file .. merely to avoid the consequences of inadvertently doing something like:

rm −r .∗

EXAMPLES

To remove files with a prompt for verification:

rm -i filenames

To remove an empty directory, type:

rmdir directoryname

To remove all the files in a directory type:

rm -i directoryname/*

Note that the above command removes files only, and leaves any directories in directoryname alone. 

A powerful and dangerous command to remove a directory would be:

rm -rf directoryname

This command removes all files and directories from directoryname without prompting for verification to remove the files nor the directories.  Therefore, this command should only be used when you are absolutely sure that all the files and directories in directoryname and directoryname itself are to be removed.

DEPENDENCIES

RFA and NFS
Rm does not display a plus sign (+) to indicate the existence of optional access control list entries, when asking for confirmation before removing a networked file. 

SEE ALSO

stat(2), unlink(2), acl(5). 

EXTERNAL INFLUENCES

Environment Variables

LC_CTYPE determines the interpretation of filenames as single and/or multi-byte characters for the rmdir command. 

LANG determines the language in which messages are displayed. 

LANG and LC_CTYPE determine the local language equivalent of y (for yes/no) queries. 

If LC_CTYPE is not specified in the environment or is set to the empty string, the value of LANG is used as a default for each unspecified or empty variable.  If LANG is not specified or is set to the empty string, a default of "C" (see lang(5)) is used instead of LANG.  If any internationalization variable contains an invalid setting, rm and rmdir behave as if all internationalization variables are set to "C".  See environ(5).

International Code Set Support

Single- and multi-byte character code sets are supported. 

STANDARDS CONFORMANCE

rm: SVID2, XPG2, XPG3

rmdir: SVID2, XPG2, XPG3

Hewlett-Packard Company  —  HP-UX Release 7.0: Sept 1989

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