From: Harald Meyer on 10 Apr 2010 20:55 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 10 Apr 2010 21:01 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 10 Apr 2010 21:04 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 10 Apr 2010 21:09 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 10 Apr 2010 21:20
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) |