RM command can delete directories or files, or recursively delete all files and directories under the specified directory
Note : RM is a dangerous command and should be used with caution, especially for beginners.
1. Usage
RM [Options] [parameters] (parameters are directories or files)
2. Command options
-F: Do not prompt, forcibly delete files or directories;
-I: Ask the user before deleting an existing file or directory;
-r,-r: Recursive Delete, all files under the specified directory and subdirectories are deleted;
-V: Displays the detailed execution of the instruction.
3. Example
[Email protected] ~]# tree test/Test/├──test1│└──test2│└──test3│└──aa.txt└──test.txt3Directories,2Files[[email protected]~]#RM-ir test/RM: Whether to enter the directory"test/"?N[[email protected]~]#RM-FR test/[[Email protected]~]# ll Total dosage4-RW-------.1Root root1530July + +: -Anaconda-ks.cfg
Linux RM Command