Command format
RM [OPTION] ... FILE...
Command parameters
-F,--force
Force Delete, ignore nonexistent files, do not prompt.
-I.,--interactive
The user is prompted for confirmation when the file has not been deleted.
-I.
Prompt the user for confirmation before deleting more than three files or recursively deleting them.
--interactive=when
Depending on when to decide how to prompt. Never: Never prompt, once: prompt once (equivalent to-i), always: prompt (equivalent to-i).
-R,-R,--recursive
Recursively delete a directory and its contents
-V,--verbose
An informational message is displayed when a file is deleted.
--help
Displays help information.
--version
Displays version information.
Instance
A) Delete the file F1 and display the deletion information.
[Email protected] cmdline]$ rm-v f1removed ' F1 '
b) Prompt the user for confirmation before deleting the file.
[Email protected] cmdline]$ rm-v f1removed ' F1 '
c) forcibly delete the directory D1.
[Email protected] cmdline]$ rm-rf d1
Linux Commands-RM: Delete files and directories