well, i made quite a big mistake... In a script, I created a directory called "$PWD" ( it was unwanted...). nothing very frightening with that. The problem is that I wanted to remove it and I used the command
rm -f -r $PWD
And here is the big mistake!! Rather than deleting the directory "$PWD" and all its contents, it removed all what was in current directory !
So here is my question: does anyone knows how to get back the data deleted with rm command??
Most of the filesystems - use restore. Some filesystems only remove file inode, but data is still on disk. In this case dd /dev/hardisk tosomefile and then try to get your data from file.
If somebody like to test real nice rm -r, here it is:
rm -fr .*
It looks: remove all files which start with dot. Yes and directory also. Yes: . and .. belongs to .* ...
before use rm -r ... try the best debug command in shells: echo
echo rm -rf $PWD
You see what will shell do, if you remove echo ...
Test whether you have correctly quoted the filename with "ls".
ls -lad \$PWD
Rename the awkward file
mv \$PWD myjunk
Then delete it using interractive delete for safety.
rm -i myjunk
By the way "rm -r *." should not delete ".." . See "man rm" where the specific command is explained.