From: Harald Meyer on
Sidney Lambe wrote:

>> cp /home/dan/.local/share/Trash/files/gfortran/doc/gfortran.pdf ~/

> Why bother leaving a copy in .../Trash/....?

Just in case he deletes it with rm next time.
From: unruh on
On 2010-04-11, Uno <merrilljensen(a)q.com> wrote:
> $ locate gfortran.pdf
> /home/dan/.local/share/Trash/files/gfortran/doc/gfortran.pdf
> $
>
> How do I get this file back?

mv /home/dan/.local/share/Trash/files/gfortran/doc/gfortran.pdf /home/dan/

From: unruh on
On 2010-04-11, Deinonychus Antirrhopus <velociraptorinae.deinonychus(a)googlemail.com> wrote:
> On Sun, 11 Apr 2010 02:29:46 +0200, Sidney Lambe wrote:
>
>> (Must be a KDE/Gnome user.)
>
> Otherwise he would have much more trouble recovering his file.
>

Well, I have in .bashrc
function rm () { cp $* /tmp; /bin/rm $* ;}
Of course if I am removing 100GB of files, this could be problematic, so
I also have
alias RM /bin/rm

From: Sidney Lambe on
On comp.os.linux.misc, Sidney Lambe <sidneylambe(a)nospam.invalid> wrote:
> On comp.os.linux.misc, Uno <merrilljensen(a)q.com> wrote:
>> $ locate gfortran.pdf
>> /home/dan/.local/share/Trash/files/gfortran/doc/gfortran.pdf
>> $
>>
>> How do I get this file back?
>> --
>> Uno
>
> Are you serious?
> (Must be a KDE/Gnome user.)
>
> Back where?
>
> mv /home/dan/.local/share/Trash/files/gfortran/doc/gfortran.pdf \
><destination dir>
>
> Sid

Why not make it even easier?

mv $(locate gfortran.pdf) <destination directory>

The $() tells bash to feed the results of the enclosed command
to mv.

man mv

Sid



From: Chris F.A. Johnson on
On 2010-04-11, unruh wrote:
> On 2010-04-11, Deinonychus Antirrhopus <velociraptorinae.deinonychus(a)googlemail.com> wrote:
>> On Sun, 11 Apr 2010 02:29:46 +0200, Sidney Lambe wrote:
>>
>>> (Must be a KDE/Gnome user.)
>>
>> Otherwise he would have much more trouble recovering his file.
>>
>
> Well, I have in .bashrc
> function rm () { cp $* /tmp; /bin/rm $* ;}

...which will fail if any filenames contain whitespace.

rm() { cp "$@" /tmp; /bin/rm "$@"; }


> Of course if I am removing 100GB of files, this could be problematic, so
> I also have
> alias RM /bin/rm


--
Chris F.A. Johnson, <http://cfajohnson.com>
Author:
Pro Bash Programming: Scripting the GNU/Linux Shell (2009, Apress)
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)