The-Unix-Shell-Teaching-Notes

3.5 Using rm Safely

What happens when we execute rm -i thesis_backup/quotations.txt? Why would we want this protection when using rm?

Solution
  rm: remove regular file 'thesis_backup/quotations.txt'? y
  
The -i option will prompt before (every) removal (use Y to confirm deletion or N to keep the file). The Unix shell doesn’t have a trash bin, so all the files removed will disappear forever. By using the -i option, we have the chance to check that we are deleting only the files that we want to remove.

Episode 3 Exercise 6