Tuesday, 21 April 2015

Write a shell script that move all of the files you delete into the .recyclebin directory

This shell program will creates a directory and that will move all of the files you deleted. This script is useful for restoraton of files after they have been removed. The intresting part is that UNIX system has no undelete capability

>Create a directory
mkdir /.recyclebin

>Write a shell script
vi /myrm
Ø  mv $1 /.recyclebin/$1

>Edit bashrc file and add line at last as
vi /etc/bashrc
Ø  alias rm=’/myrm’
Now onwards when you remove file with using rm the file will be moved to /.recyclebin directory.


No comments:
Write comments

Featured post

List of Universities in Karnataka offering M.Sc Computer Science

The post-graduate programme in Computer Science (M.Sc Computer Science) contains two academic years duration and having a four semesters....

Popular Posts

Copyright @ 2011-2016