LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
LinkBack Search this Thread
Old 03-19-2003, 08:14 AM   #1
futurist
Member
 
Registered: Mar 2002
Location: malaysia
Distribution: Mandriva 2006 RC1
Posts: 486

Rep: Reputation: 30
How to make sure deleted files are put into trash can so that I can undelete them.



How to do this in linux.
I accidently delete file and it can not be undeleted!!!



 
Old 03-19-2003, 09:00 AM   #2
NGene
Member
 
Registered: Mar 2001
Location: Turku, Finland
Distribution: Ubuntu
Posts: 66

Rep: Reputation: 15
Do you mean having a trashcan when you work at the command line and are using the rm command? If this is the case, take a look at something called Undo RM:

http://www.the-labs.com/UndoRM/

It works only at the command line, and I haven't used it myself so I don't know if it's any good...
 
Old 03-19-2003, 01:12 PM   #3
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86; Gentoo PPC; Gentoo Sparc64; FreeBSD; OS X; Solaris
Posts: 3,731
Blog Entries: 4

Rep: Reputation: 64
Or you can use a simple shell script. Create a directory in your home directory called 'trash' (if you don't already have it, you may have one in ~/Desktop/Trash) then a simple script:
Code:
#!/bin/bash
mv $1 ~/Desktop/Trash
Save it as 'del' or whatever, chmod it 755, then put it in your path (/bin, or /usr/bin is a good place). Then to use it:
del myfile
will move it to the trash for you.
 
Old 03-19-2003, 08:19 PM   #4
cuckoopint
Member
 
Registered: Feb 2003
Distribution: Debian
Posts: 797

Rep: Reputation: 30
Quote:
Or you can use a simple shell script. Create a directory in your home directory called 'trash' (if you don't already have it, you may have one in ~/Desktop/Trash) then a simple script:
you may also want some cron job to remove the contents once in a while - it could take up a lot of space if not watched correctly. But then again, if you know you're going to need it, why delete it in the first place.
 
Old 03-20-2003, 02:30 AM   #5
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86; Gentoo PPC; Gentoo Sparc64; FreeBSD; OS X; Solaris
Posts: 3,731
Blog Entries: 4

Rep: Reputation: 64
Well, the point is that sometimes you may not know you need the file. Plus sometimes you just don't pay close enough attention to what you're typing...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleted Trash icon in KDE 3.4.2 jong357 Slackware 5 09-05-2005 03:05 PM
I deleted my trash in KDE :( astrowill Linux - Software 3 06-08-2005 05:54 PM
Deleted Trash Icon By Mistake, What Now? zhuangshi Suse/Novell 4 03-26-2005 08:58 AM
make rsync output deleted files? hawarden Linux - Software 8 03-18-2005 12:24 PM
How to make deleted files auto go to trash bin? subaruwrx Slackware 1 07-24-2004 10:10 AM


All times are GMT -5. The time now is 10:47 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration