My Tech notes: Clean use of rm command
Subscribe

Unix Documentation

Free Online Unix Training Materials

Lists many links to free Unix training materials.

Pointers and Arrays Materials

Pointers and Arrays materials Explained for C beginners

C FAQ and General Questions C Interview Questions

Powered By

Free XML Skins for Blogger

Powered by Blogger

Sunday, June 15, 2008

Clean use of rm command

It is very much possible that we delete some useful files by “rm –rf” or rm, One can make use of “alias “command to prevent deleting useful files.

Like $ alias rm="rm -iv"

Whenever one uses rm it will ask for users permission

Ex.$ “rm: remove regular file `test.c'? y”

And also it will give information to user that xyz.c file is deleted,

Ex. $ removed `test.c'

One can add this line alias rm="rm -iv" in .bashrc file so that whenever user login this options will be set as default.

No comments:

Post a Comment