Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The contents of a Wordpress Tarball are all contained within a single directory called "wordpress". I would like to upload the archive to my server (CentOS) and UnTar all the files directly to the root of my webserver. The problem is that everything is decompressed into the single "wordpress" directory within my document root. How can have all the contents of the "wordpress" decompressed into my document root without the "wordpress" directory? Thanks.

share|improve this question
up vote 1 down vote accepted

It would be simpler to untar everything on the destination, and let it create the wordpress folder, then copy the contents into your root. It also gives you an "untainted" copy so that if you need to you can copy the contents over again if something goes wrong.

So lets say for instance your web root is at:


And when you untar your upload, it ends up in


The command to copy it all (except hidden files would be)

cp -ax /home/user/public_html/wordpress/* /home/user/public_html/

There is very likely a .htaccess file as well, that would need a separate copy:

cp /home/user/public_html/wordpress/.htaccess /home/user/public_html/
share|improve this answer
I see your point. How would I copy the entire contents of the "wordpress" directory over to my root? I am afraid I am new to Linux commands. Thanks. – webworm Oct 21 '11 at 5:10
Do you have shell access? I have updated my answer to show how. – Paul Oct 21 '11 at 5:13
I do have SSH access. Thanks for a detailed answer. That should work. – webworm Oct 21 '11 at 21:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .