0

Sorry for the poorly written question, but I'm panicking right now.

I accidentally mv prefix* instead of mv prefix* target_dir/

Now, there's only one prefix file left. Have I killed them? If so how/why? Is it possible to recover the files?

Morgan
  • 821
  • 2
    If you had more than two files, you should have gotten a message like mv: target ‘prefix<something>’ is not a directory. If you only had two files, you have effectively overwritten the latter with the former. If you want to attempt recovery, stop using/unmount the drive. More use increases the risk of overwriting the data. – Bob Sep 13 '13 at 16:17
  • Actually, if you're lucky, you may be able to. Step 1: *STOP USING THE COMPUTER/DRIVE/PARTITION RIGHT NOW* and do not mount it in r/w mode until you have finished recovering. – Bob Sep 13 '13 at 16:19
  • 1
    Okay, thanks! So ´mv´ doesn't ask for confirmation before overwriting files by default? Thought it did. I guess I'll have to alias ´mv -i´ - cause that will do the trick, right? – Morgan Sep 13 '13 at 16:31
  • Yes, setting that alias will cause it to prompt before overwriting by default. Note that this would only affect whichever shell you use (e.g. bash) - any program that executes mv directly, or you doing so from a different shell, would not be affected. Also (for bash) remember to set the alias within one of the config files - the alias command does not persist across sessions. – Bob Sep 13 '13 at 16:38

0 Answers0