The rm command
The rm command deletes files in a directory
The rm command will usually not produce an output unless you have made an error.
There is no "undelete" command in UNIX, once you delete a file, it is gone (unless it is on a backup tape).
Because of this, the rm command on CMGM and PMGM will ask you if you really want to delete a file before it goes ahead and does it.
Most UNIX commands have a variety of additional command modifiers that can be used to change the output. For example, if you typed
rm -r *
you would delete recursively the contents of a directory. This means the contents of a directory and all directories and files under it.
Other popular rm commands include
What to Type | What it Does |
rm *
| delete everything in a subdirectory |
rm *.txt
| remove only files with a .txt on the end |
rm data*
| remove only files that start with the word "data" |
rm -r dir2
| removes everything in the subdirectory "dir2" |
Aucun commentaire:
Publier un commentaire