-i

onethingwell:

If you want to protect a directory from a careless rm -rf *, touching a file named -i inside it will force rm to ask for confirmation :

touch ~/important-directory/-i

From Command Line Fu, via HN.

omg this is the best thing ever I’m very excited to tell the guy on my team who accidentally deleted his working directory last month.

  1. bdotdub reblogged this from ducban
  2. ducban reblogged this from onethingwell and added:
    Someday, this trick might save my life.
  3. foundonweb reblogged this from onethingwell
  4. b-llzy reblogged this from onethingwell
  5. lautunnodelluvaselvatica reblogged this from onethingwell
  6. allixsenos reblogged this from onethingwell
  7. prettyhuge reblogged this from onethingwell and added:
    omg this is the best thing ever I’m very excited...tell the guy on my team who...
  8. technotalk reblogged this from minimallinux
  9. passencore reblogged this from onethingwell
  10. mosx reblogged this from onethingwell and added:
    Very helpful. I was always tempted.../, now I can finally do
  11. justinalcon reblogged this from justinday
  12. userdel reblogged this from minimallinux
  13. jcg1013 said: nice tip. now if there were something that would help when you mention the containing directory instead of “*” — rm -rf ~/important_directory
  14. justinday reblogged this from onethingwell
  15. onethingwell posted this
Short URL for this post: http://tmblr.co/Zxv3by5lKdAW