How to recover a file you accidentally deleted?
If you
$HOME
is on a
ZFS file system[1] you can easily retrieve files you deleted from an automatic snapshot created by the system.
Just cd into the hidden
.zfs
directory and select one snapshot:
cd ~/.zfs/snapshot/
ls
Under each of the directories you will see your $HOME as it looked like at some point in the past. Just copy the wanted files from there to your actual $HOME and all should be alright again.
[1] Easy to find out with this command
mount | grep $(whoami)
If the line starts with a server named like
s09
. if it starts with hsm or the line contains
qsm
this will not work for you.
--
CarstenAulbert - 23 Jul 2010