How to force remove a directory?

0128

To forcefully remove a directory and its contents without any prompts, you can use the -f option along with the -r option in the rm command. The -f option stands for "force," and it tells the command to ignore nonexistent files and never prompt for confirmation.

Here's the syntax:

rm -rf directory_name

For example, to forcefully remove a directory named example_dir, you would run:

rm -rf example_dir

This command will recursively delete example_dir and all its contents without asking for confirmation. Be very careful when using this command, as it will permanently delete the directory and its files.

0 Comments

no data
Be the first to share your comment!