recover a lost file.....(aka, i messed up, hard)

Thomas Beckett thomas.beckett at gmail.com
Tue Oct 4 13:33:48 UTC 2005


On 10/3/05, Todd Slater <dontodd at gmail.com> wrote:
> On 10/3/05, sjoeboo <sjoeboo at sjoeboo.com> wrote:
> > hello,
> >
> > mear minutes ago, while cleaning out some directories to tidy things up,
> > i mistakenly, removed 2 files, that well, are pretty crucial to me.
> > unfortumatly, this was done via the command line with good ol' "rm". it
> > is an ext3 filesystem and i was wondering if anyone knew of any
> > way/program to help me get these 2 files back. like i said they were
> > just deleted a minute or 2 ago, and, were small text files (php to be
> > more exact) any help?
> >
> > mat.
>
> I have used foremost for recovering deleted files from a compact flash
> card. I believe it will work with various file systems.
>
> http://foremost.sourceforge.net/
>
> Good luck!
>
> Todd

Foremost looks like it could be good, but to stop it happening again
could an alias be set up such as rm=mv $1 ~/.trash

I have no idea if this will work - Cant test it until i get home
tonight. Im also not sure if you can use parameters in a basic command
alias so you could possibly put

#!/bin/bash
mv $1 $home/.Trash

into a file and alias the rm to this to make a wrapper. This will only
work for a single parameter but im sure some of the bash gurus could
expand it to take into account any number of arguments passed and make
it better

Tom




More information about the ubuntu-users mailing list