About rm
The rm command removes (deletes) files or directories.
Syntax
rm [OPTION]... FILE...
Description
rm removes each specified FILE. By default, it does not remove directories; seeRemoving Directories below for details.
The removal process unlinks a filename in a filesystem from data on the storage device, and marks that space as usable by future writes. In other words, removing files increases the amount of available space on your disk.
The data itself is not destroyed, but after being unlinked, it becomes inaccessible. Remove your files wisely! The effects of an rm operation cannot be undone.
Note: If what you want is to completely, unrecoverably erase the data on the disk, use the shred command instead. This will overwrite the file's contents so that they cannot be reconstructed later by any means.
When using rm, if the -I or --interactive=once option is given, and there are more than three files or the -r, -R, or --recursive are given, rm will prompt the user for whether to proceed with the entire operation. If the response is not yes, the entire command is aborted.
Otherwise, if a file is unwritable, standard input is a terminal, and the -f or --forceoption is not given, or the -i or --interactive=always option is given, rm prompts the user for whether to remove the file. If the response is not yes, the file is skipped.
Options
-f, --force | Ignore nonexistant files, and never prompt before removing. |
-i | Prompt before every removal. |
-I | Prompt once before removing more than three files, or when removingrecursively. Less intrusive than -i, while still giving protection against most mistakes. |
--interactive[=WHEN] | Prompt according to WHEN: never, once (-I), or always (-i). If WHEN is not specified, then prompt always. |
--one-file-system | When removing a hierarchy recursively, skip any directory that is on a file system different from that of the corresponding command line argument |
--no-preserve-root | Do not treat "/" (the root directory) in any special way. |
--preserve-root | Do not remove "/" (the root directory). This is the default behavior. |
-r, -R, --recursive | Remove directories and their contents recursively. |
-v, --verbose | Verbose mode; explain at all times what is being done. |
--help | Display a help message, and exit. |
--version | Display version information, and exit. |
No comments:
Post a Comment