To remove directories interactively using the rm command, you can use the -i option along with the -r option. The -i option prompts you for confirmation before each deletion, allowing you to review what will be removed.
Here's the syntax:
rm -ri directory_name
For example, to remove a directory named example_dir interactively, you would run:
rm -ri example_dir
You will be prompted to confirm the deletion of each file and subdirectory within example_dir. You can respond with y (yes) to confirm or n (no) to skip the deletion for that item.
