rm

remove files

Command


SYNOPSIS

rm [-fiRrv] [-d|s] file ...


DESCRIPTION

rm removes each specified file argument (provided that it is a valid path name). If you specify either . or .. as the final component of the path name for a file, rm displays an error message, and moves onto the next file. If you specify a file you do not have write permission for, rm asks you for confirmation. Type the yes expression defined in LC_MESSAGES (the English expression is typically y or yes) if you really want it deleted.

Options

-d

delays the removal of the specified files until the system is rebooted. This option and the -s option are mutually exclusive.

This option relies upon the underlying operating system's capability to perform the action at reboot time.

-f

deletes read-only files immediately, without asking for confirmation. When you specify this option and a file does not exist, rm does not display an error message and does not modify the exit status. If you specify both -f and -i, rm uses the option that appears last on the command line.

-i

prompts for confirmation before deleting each file or confirmation before entering a subdirectory if either the -r or -R option is specified. If you specify both -f and -i, rm uses the option that appears last on the command line.

-R

recursively removes the entire directory structure if file is a directory.

-r

is equivalent to -R.

-s

saves the file for undeletion if possible. An attempt is made to put the file in the Recycle Bin and if this attempt fails then the file is quietly deleted. This option and the -d option are mutually exclusive.

-v

prints file names to standard output as they are being processed.


DIAGNOSTICS

Possible exit status values are:
0

Successful completion.

1

Failure due to any of the following:

— inability to remove a file
— tried to remove directory without specifying -r or -R
— inability to find file information when using -r or -R
— inability to read directory when using -r or -R
2

Failure due to any of the following:

— invalid command line option
— no files specified


PORTABILITY

POSIX.2. x/OPEN Portability Guide 4.0.

The -d, -s, and -v options are extensions to the POSIX standard.


SEE ALSO

Commands:
cp, mv, rmdir


Updated MKS Toolkit [3khat16.ico]HP3000 [3khat16.ico]3kMail [archive16.gif]