So, I was in a folder where I maintain many other folders and subfolders. I accidentally run the command:

find /*/* -prune -type d -exec mv -t /home/myname/Music/Jazz/test {} +

obviously without knowing what I was doing. Now I see hundreds of folders coming from root directories in the target directory. I assume I moved folders from /lib, /proc and others. I'm afraid to restart the pc. Is there any way to reverse what I did?

  • I don't think there is a way to reverse what you did, unless you happen to have saved the output to a file – NerdOfLinux Nov 16 '17 at 16:06
  • I do a search for random folders that seem moved and I see them in their original directories with same contents. Can it be the case that the command simply copied them because I didn't run it as sudo? Or do they show up because I'm still logged in and after a restart they will be removed? – Jimakos Nov 16 '17 at 16:23
  • 1
    Please run ls -al /home/myname/Music/Jazz/test and add to question lets see what was moved! – George Udosen Nov 16 '17 at 17:20

If you didn't mess with permissions before, there should not be many directories in /*/* that a nonprivileged user may move. I suppose that you moved only your own /proc/* directories, perhaps /var/tmp or /tmp, too.

/lib, /opt and other directories cannot be moved with your userID.


I was not in a root shell so it seems that all folders remained in their original places as well. A kind of copy operation then and after deleting the moved folders and restarted all were fine. We mark this as solved.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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