DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

rm(1)


rm -- remove files

Synopsis

rm [-firR] file ...

Description

rm removes the entries for one or more files from a directory. If a file has no write permission and the standard input is a terminal, the full set of permissions (in octal) for the file are printed to stderr, followed by a question mark. This is a prompt for confirmation. If the answer is an affirmative response, the file is deleted, otherwise the file remains. (The form of an affirmative response is locale dependent: ``y'' in the C locale, see LANG on environ(5)).

If file is a symbolic link, the link will be removed, but the file or directory to which it refers will not be deleted. A user does not need write permission on a symbolic link to remove it, provided they have write permissions in the directory.

Note that if the standard input is not a terminal, the command will operate as if the -f option is in effect.

rm has the following options:


-f
This option causes the removal of all files (whether write-protected or not) in a directory without prompting the user. In a write-protected directory, however, files are never removed (whatever their permissions are), but no messages are displayed. If the removal of a write-protected directory is attempted, this option will not suppress an error message.

-i
With this option, confirmation of removal of any files occurs interactively. It remains in effect even if the standard input is not a terminal. If both -i and -f options are present on the command line, the last option takes precedence.

If -i and either -R or -r are specified, confirmation for removal of directories occurs twice: once when the directory is entered and once after all files have been removed from the directory and the directory itself is being deleted.


-r
This option causes the recursive removal of any directories and subdirectories in the argument list. The directory will be emptied of files and removed. Note that the user is normally prompted for removal of any write-protected files which the directory contains. The write-protected files are removed without prompting, however, if the -f option is used, or if the standard input is not a terminal and the -i option is not used. Similarly, if an attempt is made to remove a non-writable directory, you will be prompted, unless -f is specified.

Symbolic links that are encountered with this option will not be traversed.

If the removal of a non-empty, write-protected directory is attempted, the command will always fail (even if the -f option is used), resulting in an error message.


-R
This option is the same as -r.

Files


/usr/lib/locale/locale/LC_MESSAGES/uxcore.abi
language-specific message file (See LANG on environ(5).)

Diagnostics

All messages are generally self-explanatory.

If either the files . and .. are specified as the basename portion of an operand (that is, the final pathname component), rm writes a diagnostic message to standard error and does nothing more with such operands. The message tells you that rm can't remove the current directory or .. .

References

rmdir(2), unlink(2)

Notices

A -- permits the user to mark explicitly the end of any command line options, allowing rm to recognize filename arguments that begin with a -. As an aid to BSD migration, rm will accept - as a synonym for --. This migration aid may disappear in a future release. If a -- and a - both appear on the same command line, the second will be interpreted as a filename.

This command has been updated to handle files greater than 2GB.


© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004