rm - remove directory entries
Synopsis
Description
Environment Variables
See Also
Notes
rm [-fiRr] file ...
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 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.
When rm encounters a symbolic link, the link will be removed, but its target will remain in the file hierarchy.
The rm command accepts the following options:
-f No questions are asked and neither error messages are printed nor the exit status is affected in case of nonexistent files. /usr/5bin/rm and /usr/5bin/s42/rm will not print an error message if removal of a file failed. For /usr/5bin/posix/rm and /usr/5bin/posix2001/rm, any previous occurrences of the -i option are ignored. -i Causes rm to ask for confirmation before deleting any file, and, unter -r, whether to examine each directory. For /usr/5bin/posix/rm and /usr/5bin/posix2001/rm, any previous occurrences of the -f option are ignored. -R Same as -r. This option has been introduced by POSIX.2. -r Rm will recursively delete the entire contents of directories given as operands, and the directory itself. Without this option, an error comment is printed if a designated file is a directory.
SYSV3 Causes the text of some messages to be changed.
rmdir(1), unlink(2), rmdir(2)
It is forbidden to remove the files '.' and '..' merely to avoid the antisocial consequences of inadvertently doing something like 'rm -r .*'.With /usr/5bin/rm and /usr/5bin/s42/rm, a single '-' can be used to indicate the end of the options list, as with 'rm - -file'. If '--' is used to terminate the options list, though, a following '-' will be interpreted as a file name, so 'rm -- -' will remove the file '-'.
Heirloom Toolchest | RM (1) | 1/24/05 |