How To Tar-Untar – Zip/Unzip a directory and move to another user
In Linux from the command line, you can tar-untar, or as most people will know zip and unzip a directory. This is useful if you want to move a WordPress site to a different account or. Let’s assume you want to move the whole public_html folder under the user test to a user on the same server that has the username transfer.
First, let’s get to the users home directory
Then let’s tar/zip the public_html folder and place the file that’s created in the new users home directory
tar /home/test/public_html /home/transfer/
Once complete you can then move the new users home directory
List the directory contents
You should see the public_html.tar.gz file in the directory. Let’s untar-unzip the file overwriting any files already in the directory
tar -xvf public_html.tar.gz
That account should now have an exact copy of the public_html folder from the user test.
How was this article?