Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I typed a command to refactor my file from the current folder I was in to another folder.

What I wanted was: mv /var/backup /var/www/backup

However, I typed: mv /var/backup /var/www/

Now I can't seem to find my file anywhere! Is there a way I can recover it?

share|improve this question
Have you looked in /var/www? It should be there as long as the /var/www directory existed. If it did not, your file has been renamed to /var/www. – terdon May 11 '14 at 15:28

If some error happened, mv prints an error message and returns a non-zero status.

If mv didn't print anything then the move happened as you wrote it:

  • If /var/www did not exist, then you renamed /var/backup to /var/www.
  • If /var/www was an existing directory, then you moved /var/backup to /var/www/backup.

If neither of these happened, then either you typed a different command or you (or someone else) did something else to those files afterwards.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.