I was trying to move a folder "Foxit Reader" which was located in /opt to the home Directory. I searched on how to do that and they told me to do this :

sudo su 
cd /opt
mv -t Foxit\ Reader/ /home

But apparently what it did was moving all the home to inside the foxit reader folder. and now I can't open anything, how can I fix this?

  • Your /opt or / on the same partition as your previous /home? – c0rp May 12 '14 at 11:06
  • 1
    Did you try to do the reverse operation ? If you are in the same directoy which you executed the above commands, try sudo mv Foxit\ Reader/home/* /home ? What did you mean by Cant open anything what did you try to open ? Be careful when trying these commands. I hope you didnt restart the machine – Jay Aurabind May 12 '14 at 11:07
  • all the contents inside home folder were transferred to /opt/Foxitreader – Eyadkht May 12 '14 at 11:11
  • 1
    @eyadkht good you got it fixed but for next time: please carefully read what a command does! This one is easy to fix but I know several that can not be reversed ;) – Rinzwind May 12 '14 at 11:25

The "-t" means that "Foxit\ Reader/" is the target to move the files to. And the next argument is assumed to be the source from where to move it from.

From the manual:

 -t, --target-directory=DIRECTORY
          move all SOURCE arguments into DIRECTORY

You can fix this by doing:

sudo su 
cd /opt/"Foxit Reader"/
ls -l *

and visually confirm you see a list of users (that are directories) (not Desktop, Pictures etc) and not files. Then you can do ...

mv * /home/

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.