When I feel like scrapping the whole project and starting over:

Me: (in the project dir) sudo rm -rf /*
Me: (after waiting a while) Something feels off… Why is it taking so long to delete everything?
Me: (suddenly realizing) ^C ^C ^C
System: Press any key to continue...

当我想把整个项目推倒重做时:
我:(在项目目录)sudo rm -rf /*
我:(等了一会儿)有点不对劲。。。怎么删了这么长时间还没删完
我:(恍然大悟)^C ^C ^C
系统: Press any key to continue...

you are viewing a single comment's thread
view the rest of the comments
[–] 20 points 1 day ago* (1 child)
mv folder delete-this
rm -rf delete-this

gives you one chance to reconsider what you just did before it is too late. And you never have a risk of a dangerous delete-all lurking in your command history.

  • source
  • hideshow 1 child comment
  • [–] 1 point 15 hours ago

    Or rm -rf dir instead a relative path. Write down the actual path or directory name you want to delete. Do not use only variables for the path. But combining with literals is fine, such as dir/${subdir}/* . One can also test if the directory exists before starting the process, especially useful in scripts. And I recommend using --verbose option to see what is being deleted: test -d dir && rm -rfv dir

  • source
  • parent