Sunday 18 August 2013

Creating Backup of Files While Deleting

Problem Description – We usually tend to use rm -f or rm -rf commands to delete files and directories in UNIX/Linux. There is high possibility that some of important files get deleted by mistake (as in the case of rm -f *).
Solution – one way is to create link with other file which starts with dot(.)
normally rm or copy … will not effect on dot files
example:
ln ABC_file .ABC_file
rm -f * # you will save “ABC_file” because there is one link
“.ABC_file” …

No comments:

Post a Comment