A lot of times when I'm unzipping files, I'll get a messed up directory structure that looks like /home/bob/myfolder/myfolder/otherstuff. Where the only thing that the first myfolder contains is another directory named myfolder.

How could I collapse this path to get /home/bob/myfolder/otherstuff? I.e. I want to remove the useless in-between link.

  • Not really a question. I am assuming you know how to use cd , mkdir, cp, mv etc.... – dearN Oct 28 '12 at 23:05

Using your example, open a terminal and do:

cd /home/bob
mv myfolder myfolder1
mv myfolder1/myfolder .
rm myfolder1

Or just cut/paste in a file browser.

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.