28 April 2015

How to create a Recycle Bin in Linux?

How to create a Recycle Bin in Linux?

Try This At first create a folder named as MyTrash under /root ie: /root/MyTrash
Then open .bashrc file and write the below line at the bottom of the file.
alias rm='mv -t /root/MyTrash/'
Here -t means
-t, --target-directory=DIRECTORY
       move all SOURCE arguments into DIRECTORY
update .bashrc file by running this command source .bashrc
Now if you delete any file using rm command that file will be moved to /root/MyTrash directory

No comments:

Post a Comment