rm
FilesBeginner In simulator In real LinuxRemove files or directories
Name: rm = remove
You can practise it right away in the simulator, and use it in real Linux mode too.
Description
rm deletes files. There is no recycle bin on the command line and deleted files are usually gone for good, so be careful, especially with wildcards and -r.
Strictly speaking, rm removes a directory entry (a name) linking to the file; the space is freed once no links remain and no process has it open. Deleting needs write permission on the directory, not on the file itself.
Syntax
rm [OPTION]... FILE...Common options
| -r / -R / --recursive | Remove directories and their contents recursively |
| -f / --force | Force: never prompt, ignore missing files |
| -i | Ask before every removal |
| -I | Ask once before removing more than three files or recursively (less tiresome than -i, safer than nothing) |
| -d / --dir | Remove empty directories too |
| -v / --verbose | Explain what is being done |
| --one-file-system | When recursive, stay on this file system (skip mounted disks) |