Tar-Untar – Zip/Unzip a directory and move to another user

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

cd /home/test

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

cd /home/transfer

Cheap VPS

List the directory contents

ls

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.

Linux VPS Servers | Cheap Dedicated Server Hosting

How was this article?

Tar-Untar – Zip/Unzip a directory and move to another user
How was this post?
cPanel VPS Server

cPanel Dedicated Servers Migrations VPS Servers

Select Language
We are currently updating our website. Please accept our apologies for any disruption you may see.
+