LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-05-2005, 04:08 AM   #1
arunsri
Member
 
Registered: Mar 2005
Distribution: Slackware 10.1
Posts: 49

Rep: Reputation: 15
"rm" command help


HI all

What is the procedure to recover the file/ atleast the contents when i delete a file using rm command?
Is there any other temp. file deletion command....;like recovering from the recycling bin etc.?
Thanks
 
Old 03-05-2005, 04:58 AM   #2
/bin/bash
Senior Member
 
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802

Rep: Reputation: 47
Depending on how your desktop is setup you may have a trash folder which is where you put files pending deletion. Otherwise you'll need to go to freshmeat and search for undelete, there are several tools to undelete files but I think most only work with ext2 or ext3 files. The last time I checked there were no undelete tools for reiserfs, so if your filesystem is reiserfs I think the files are gone.
 
Old 03-05-2005, 07:56 AM   #3
andrewlkho
Member
 
Registered: Jul 2003
Location: London
Posts: 548

Rep: Reputation: 30
If something's removed via the 'rm' command from a shell, then there's no easy way to remove it (i.e. it doesn't get sent to any Trash Can or anything like that). Thus, as /bin/bash said, you'll need to search somewhere for some undelete utilities, but it depends on your filesystem (it's a bit dodgy - you can't guarantee recovery).

If you deleted it via whatever DE / WM you used, they may have moved it to their own Trash Can, but that'll be pretty obvious (on your desktop or something). You can create a command similar to 'rm' with a "move to Trash Can" option very simply. For example, a quick and sloppy way to do it would be to create a shell script 'rmm' somewhere in your $PATH which would move it to ~/.Trash or something.
 
Old 03-05-2005, 10:26 AM   #4
/bin/bash
Senior Member
 
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802

Rep: Reputation: 47
I have a very simple function in my .bashrc file:

del() {
mv -i $@ ~/Desktop/Trash
}
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell Script: Find "Word" Run "Command" granatica Linux - Software 5 07-25-2007 08:42 AM
cdrecord command-line parentheses "(" ")" coolingtower Linux - Software 1 10-28-2005 12:49 PM
"stalled" problem in " scp" command gentleshark Linux - Software 1 08-30-2005 03:08 AM
Tiny Sofa 2.0 - I thought "halt", "reboot" were only root command ?? sorcerer Linux - Distributions 1 08-21-2004 04:28 PM
"segmentation error" when issuing "useradd" command through terminal with RH 9.0 kaihuang Linux - General 0 10-22-2003 12:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:51 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration