1. Function: Delete files or folders
2. Usage: RM [options] File or folder
3. Parameters:
-F,--force Force Delete
-I confirm each file before deleting it
-I prompts you once to delete multiple files or to delete them recursively.
--interactive[=when] need to confirm when deleting, have when, once (-i), always (-i) three kinds of options
-R,-R,--recursive to delete files and folders recursively
4. Example
Example 1: In the case of parameters not specified parameter, for each file that needs to be deleted, confirm whether to delete; the directory cannot be deleted by default; the same effect as the specified parameter-I
[[email protected] test]# ls
Test_1 test_1.txt test_2.txt test_3.txt test_mv.txt
[email protected] test]# RM test_*
RM: Cannot delete "test_1": is a directory
RM: Do you want to delete the normal file "Test_1.txt"? Y
RM: Do you want to delete the normal file "Test_2.txt"? Y
RM: Do you want to delete the normal file "Test_3.txt"? Y
RM: Do you want to delete the normal file "Test_mv.txt"? N
[email protected] test]# ls-lh
Total dosage 8.0K
Drwxr-xr-x 3 root root 4.0K May 18:09 test_1
-rw-r--r--1 root root 16 May 18:12 Test_mv.txt
Example 2: Specifying the parameter-I is confirmed only once.
[email protected] test]# rm-i test_*.txt
RM: Delete all parameters? Y
[[email protected] test]# ls
Test_1
[email protected] test]# ls-lh
Total dosage 4.0K
Drwxr-xr-x 3 root root 4.0K May 18:09 test_1
Example 3: Forcing a file file when you specify the-f parameter
[[email protected] test]# ls
Test_1 test_1.txt test_2.txt Test_3.txt
[email protected] test]# rm-f test_*.txt
Example 4: Force the deletion of files and directories using the-RF command.
[[email protected] test]# ls
Test_1 test_1.txt test_2.txt Test_3.txt
[email protected] test]# RM-RF *
[email protected] test]# ls-lh
Total dosage 0
Linux Common command Rollup--rm