1

I'm in a bind and still a linux newbie. I've read some posts about lost folders but they seem to be different situations. Earlier today, I right-clicked on a folder and selected "move to" and selected a destination. Afterwards, I realized that the folder had just disappeared. If i use terminal and type 'locate folder', it indicates '/home/steve/Documents/folder'. I don't understand how it should display that if the folder is gone. If I change directories to "Documents" and hit "ls", folder is not there (and I can't see folder in Documents via the GUI either). If I try to 'locate' or 'find' any of the files that were in the folder, it says they do not exist. Unfortunately, it's a very important folder which was not yet backed-up. I was tempted to try photorec but wanted to seek some advice before trying anything. The file types lost would be pdf's, ods's (Libre office calc) odt's (Libre office write) and odp's (Libre Office Impress). I have rebooted since this happened but I haven't saved any new files. Any suggestions as to what I should try? Is photorec a good start?. I would really appreciate some guidance as this wasn't data for "learning" linux ... this was important stuff for my work. Thank you

Edit: I should mention that the destination is formatted NTFS ... I'm pretty sure I have "moved" files there before and I have definitely "saved" files directly there

9
  • What happens if you do ls -l --all instead of plain ls? Apr 28, 2017 at 1:25
  • Thanks for the suggestion Android Dev. I just tried it but the folder doesn't appear in the list. But I'm searching the source directory .. maybe I should try the the intended destination
    – Steve H
    Apr 28, 2017 at 2:09
  • I would, in a terminal type 'man find' and 'man grep'. This will give you the man pages for these 2 commands, which may help you find the directory or the files in said directory. Some reading will be required, but working these 2 commands may give you what you seek.
    – Craig
    Apr 28, 2017 at 2:16
  • Also, the command given by @Android Dev should be commanded while in the / directory and should give a listing of all folders and subfolders on your file system.
    – Craig
    Apr 28, 2017 at 2:22
  • 1
    The solution was posted in a comment by the author of the question: I found the file just as you were writing this ... I went through the motions of doing a move again to see what the menus looked like etc. THE far right column of the dialogue box gives the date when each folder was last modified and I noticed a folder had been modified today but I hadn't been in there for a few weeks. I opened it a voila.
    – karel
    Apr 29, 2017 at 3:28

1 Answer 1

0

I'd recommend a command like this to check a wider expansion of possible places it might have been moved:

find /home/ -type d -name "folder"

Run the command as root and make sure you place the name of the actual folder rather than the word folder if that is not its name. The above command will check all directories in the /home/ directory for that name. To expand even further you could change it to:

find / -type d -name "folder"

Make sure to still be running the command as root. Also, keep in mind that the above command will take a much longer time since it will be checking all the directories on the system. You may also get some permission denied errors in directories like /proc/, /sys/, or /dev/ and that is normal due to the nature of those directories.

Also, if you decided you wanted to use the above commands to look for one of those files you'll need to change the type from "d" to "f" so that it checks file names instead of directory names.

If it's still not found then it was either moved to a now unmounted partition/disk/usb or was deleted by mistake. If it was deleted by mistake then a tool like photorec could potentially save the data, but if it was moved then possibly not. Either way, if you're going to try a tool like photorec I recommend making a full backup of your system first just in case.

As a side-note: The locate command uses a database that is built once a day by default. If the directory was removed after it was built, that would explain why it says it still exists. Also, if it was in a new location that would explain why it does not find it.

5
  • Thank you TopHat. I found the file just as you were writing this. I'm sorry to have troubled you but your answer looks very informative so I'm going to try it just for the sake of learning. I really appreciate the help
    – Steve H
    Apr 28, 2017 at 2:50
  • No problem @SteveH! I'm glad you found it. :) How did you end up finding it on your end?
    – TopHat
    Apr 28, 2017 at 2:51
  • I went through the motions of doing a move again to see what the menus looked like etc. THE far right column of the dialogue box gives the date when each folder was last modified and I noticed a folder had been modified today but I hadn't been in there for a few weeks. I opened it a voila.
    – Steve H
    Apr 28, 2017 at 2:59
  • Ah, well I'm glad that worked out. If the directory name was still the same, my find commands should have been also successful at finding it. If the name had been changed then my find commands would not have worked.
    – TopHat
    Apr 28, 2017 at 3:04
  • @SteveH out of curiosity, did you end up testing my solution to see if it would have worked as well?
    – TopHat
    May 5, 2017 at 20:49

Not the answer you're looking for? Browse other questions tagged .