Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I've a done wrong use of sudo mv command. Example:

sudo Mv/home/USER/Downloads/piff.pdf /root/PDFs

Then the directory /root/PDFs has been changed to a plain text file.

I can undo the command? I can retrieve the directory?

share|improve this question
    
The command you typed is invalid so the answer you get from me has assuptions. Please clarify what you mean. –  Rinzwind Feb 10 '13 at 7:21
add comment

1 Answer

If the problem is that you forgot to add a / at the end then ...

sudo mv /root/PDFs /home/USER/Downloads/piff.pdf

will restore the file to its original location and then you can redo the move with...

sudo mv /home/USER/Downloads/piff.pdf /root/PDFs/.

Warning: this ONLY works on the assumption that you intended to move the file to directory /root/PDFs and forgot to add the /. I do also want to make a comment that if that is the case the actual mv you tried should have given an error (since the wrong move you made only works when the directory does not exist).

share|improve this answer
add comment

Your Answer

 
discard

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.