How to Use RM commands in Linux --- How to delete files or directories in Linux Users can useRmCommand to delete unnecessary files. This command is used to delete one or more files or directories in a directory. It can also delete a directory and all its files and subdirectories. For linked files, the link is closed, and the original file remains unchanged. RmThe command is generally in the following format:Rm[Option]... directory... Delete the specified <File> (unlink ). -D -- Directory: delete directories that may still have data (only for Super Users) -F -- force: the file does not exist and no information is displayed. -I -- Interactive must be confirmed before any deletion operation. -R/r -- Recursive: delete all directory layers under the directory at the same time -V -- verbose detailed display steps -- Help: displays the help information and leaves -- Version: displays the version information and leaves. To delete an object whose first character is '-' (for example, '-foo'), use one of the following methods: Rm---Foo Rm./-Foo Note that if you use RM to delete a file, you can restore it to its original state. If you want to ensure The content of this file cannot be restored. Please use shred. Example: Delete all RB program files. Before deletion, ask for confirmation one by one: Rm-I *. Rb Delete all files in the finished subdirectory and subdirectory: Rm-r finished Delete the finished sub-directory and all files in the sub-directory, and do not need to -- OK: Rm-RF finished |