Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I made a mistake when moving a set of file by this command mv src/* .. instead of mv src/* .

share|improve this question
    
See superuser.com/questions/279733/undo-an-rm-rf-command for some possible solutions. –  isomorphismes Aug 28 '12 at 23:51
add comment

3 Answers 3

up vote 7 down vote accepted

You can try using find to discover which files in ".." was modified at the time you made the erroneous mv, and then mv them in the right place again (using -exec find option for example).

share|improve this answer
    
Thanks for your suggestion ! I use this command find ../* -mmin -5 -type f -exec mv '{}' . ; I saw that it mv all the file in parent directory include file're not modified. Do you have any ideas for this command ? –  billyduc Sep 10 '09 at 2:57
add comment

You cannot 'undo' it easily other than by sorting out which files belong where and to move them back again. Alternatively, you could restore from a backup and then compare the files from the backup and the present system to help.

share|improve this answer
add comment

I don't think there's any. Same goes with rm, which is different from trashing.

share|improve this answer
    
Hey, it's not exactly true that there's nothing you can do to get a rm or mv-ed file back. The (negentropic) bits are still there, arranged in the right sequence. Kust the pointer in the file allocation table is gone. It's not impossible but it is difficult to find the bits and put the pointer back. –  isomorphismes Aug 28 '12 at 23:42
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.