I have saved a text file using Gedit text editor in my /home/Desktop directory. Unfortunately there was already a text file with the same name there, so its content has been lost. I use Ubuntu 16.04 and ext4 filesystem.
This question explains how to recover its content if you remember some text of the file that has been replaced: Can overwritten files be recovered?
It uses this command:
grep -i -a -B100 -A100 'text in the deleted file' /dev/sda1 > recovered-text.txt
The problem is that I can not remember some of the text of the lost file. It was an old file which I had not opened in a long time.
Is there a way to retrieve it if I only know the name of that text file? Is there a chance that the filename is saved as metadata in disk next to the file content which I could grep? Any suggestions?