Key Options
The `rm` command allows various ways to specify deletion targets and includes options for error prevention such as forced deletion, recursive deletion, and interactive mode.
1. Basic Options
2. Error Prevention/Confirmation Options
3. Force/Recursive/Extended Options
Generated command:
Try combining the commands.
Description:
`rm` Executes the command.
Combine the above options to virtually execute commands with AI.
Usage Examples and Safety Guidelines
This section summarizes precautions, safe usage methods, and option combination examples for the `rm` command.
Tips for Safe Usage
Please be sure to familiarize yourself with the following when using the rm command.
- - Deleted files are generally unrecoverable.
- - Commands like
rm -rf /can delete the entire system, so absolutely avoid using them! - - Get into the habit of using
-ior-Ioptions. - - Be especially careful to prevent errors when using wildcards (*) in filenames.
Deleting a Regular File
rm test.txt
Delete the `test.txt` file
Recursive/Forced Deletion
rm -rf backup/
Forcibly delete the `backup` directory and all its contents
Confirm Before Deletion
rm -i important.txt
Always confirm for every deletion operation