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 NVMe VPS 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 untar zip unzip ssh
tar /home/test/public_html /home/transfer/
Once complete you can then move the new users home directory
cd /home/transfer
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.
Install a free firewall. Install CSF
How was this article? Tar untar zip unzip ssh
More from All About Linux
Install Ioncube Loaders In Ubuntu, Debian, CentOS and AlmaLinux
Ioncube Loaders are a piece of software that is used to protect the underlying code in PHP applications. Its aim …
How to install FTP and configure FTP on an Ubuntu 22 LTS instance
If you need to upload files to your NVMe VPS you have a couple of options. You can use a …
How to install a Cloudflare Origin SSL Certificate – NGINX
An SSL Certificate is vital to encrypt data between you and your clients. SSLs can be complicated things. If they …