This question already has an answer here:
mv ~ /dev/null
moves my home directory to a black hole. Can I recover my home directory from
The accepted existing answers are at least partially incorrect.
Still, I wouldn't recommend testing it on a home directory with irreplaceable data. Here's a quick test harness with a new user called
If something you wanted does end up in
Just to clarify that you can
Obviously if you want to rescue your file be quick and
In such a case, the first thing to do is to stop the system. The hope is that the files are still somewhere on the hard disk; by stopping the system we want to avoid that they are overwritten (if removed, they are marked as free space).
The second thing to do is to read data recovery manual and follow the instructions therein. Unfortunately, this succeeds as often as not.
The third is to check your backups (there are two sorts of people: those who do backups and those who will; hope you are the former kind).