Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linux has implemented the concept o

Status
Not open for further replies.

MrRohan

Programmer
Feb 19, 2002
59
0
0
IN
Linux has implemented the concept of a Trash Can, but it would work only when u delete files from the explorer ( eg nautilis ), but what happens when u delete the file from a terminal using the rm command, it gone forever.

heres a small tip to implement the same Trash Can concept while in terminal mode.

include the following statement in ur respective "~rc" file or which ever startup file u feel comfortable with.

alias rm=`mv --target-directory=$HOME/.Trash`

generally the directory named .Trash will be available in ur home directory if not u will have to create it.

now u can use ur rm command without thinking as usual.
incase u have deleted and want it back, use the mv (move) command to get it back in the required directory.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top