When copy and pasting commands with a space at the end it automatically runs the command without requiring the user to press enter.
This is why I overwrote a large text file with a cp ./newfile ./oldfile
command.
How can I restore the oldfile after I aborted the command?
The oldfile is on a hard drive encrypted with VeraCrypt which is mounted (an ext4 partition).
The file is not still in use.
I already tried sudo grep -i -a -B100 -A100 'text in oldfile' /dev/sdx1 > ./restored
(replace sdx1 with what's displayed with lsblk -f
) but it doesn't find anything. Should it work with this command? Is it possible at all?