Saturday, June 22, 2013

Bash bits and pieces


  • Create a file named -i in the directory like $touch a; mv a -i;
  • Now if you to accidentally rm * , file -i will be treated as argument to rm and will run rm command in interactive mode preventing accidental deletion of files.
  • Even if you delete all the files following the interactive command file -i will not be deleted.
  • Enjoy!

No comments: