0

I was trying to move all Video files(not Directory) from withing my Downloads folder to the Videos folder...

I assumed I was safe as in my mind move is not delete. I may be learning that this is the case the hard way.

I tried the following command:

find /home/billy/Downloads -type f -iname "*.mkv" -o -iname "*.mp4" -o -iname "*.avi" | xargs /bin/rm -f | xargs -I list mv list /home/billy/Videos/

It looked like it worked as the video files were gone from the sub directories. But they didn't land in the Video Directory at all. In fact, I can't find them anywhere. I try a locate *.mkv and it finds my files and says they are right where they were. However, the files aren't there when I navigate to the containing folders...

Are the files recoverable?

Does anyone know where my silly command may have put them?

Why can locate find them but they aren't there?

5
  • Just saw this about the locate function. locate uses a database called locatedb. It's normally updated by system cron jobs. If the DB hasn't been updated, it'll show non-existent or new files/directories. you can force an update with the updatedb command. See this link among others.
    – Billy Leo
    Nov 9, 2015 at 12:18
  • So I guess I just deleted all my movies :'(
    – Billy Leo
    Nov 9, 2015 at 12:19
  • 3
    What did you expect from the /bin/rm -f command?!
    – qasdfdsaq
    Nov 9, 2015 at 12:28
  • you will have to attempt to undelete them with data recovery tools. Nov 9, 2015 at 13:15
  • Shut down your system as fast as possible and get some recovery tool, maybe you can restore some of them. Don't write anything further to this hard disk / partition as it will reduce the chance of successfully recovering your files.
    – scai
    Nov 9, 2015 at 14:26

1 Answer 1

1

You didn't move your files. You removed them. The following bit of your command does this:

xargs /bin/rm -f

As pointed out in the comments, the locate command can find them because it is using an outdated database. It's time to restore from backup.

4
  • I was messing around with the recomendations on this page: cyberciti.biz/tips/howto-linux-unix-find-move-all-mp3-file.html
    – Billy Leo
    Nov 9, 2015 at 14:16
  • This page doesn't contain a call to rm.
    – scai
    Nov 9, 2015 at 14:23
  • 1
    @scai I copied the command from the question itself. I'm not sure why you can't see it, but it's definitely there. The full command is: find /home/billy/Downloads -type f -iname ".mkv" -o -iname ".mp4" -o -iname "*.avi" | xargs /bin/rm -f | xargs -I list mv list /home/billy/Videos/ Nov 9, 2015 at 14:25
  • 1
    @ChrisInEdmonton I wanted to refer to the page mentioned by BillyLeo, sorry for the confusion :)
    – scai
    Nov 9, 2015 at 14:59

You must log in to answer this question.

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