How to copy folder in linux?

Linux Server Management Tips and Tricks
Post Reply
arnlweb
Site Admin
Posts: 95
Joined: Wed Jun 22, 2016 1:28 pm
Location: India
Contact:

How to copy folder in linux?

Post by arnlweb » Sun Jun 26, 2016 11:35 am

You can copy any folder to another folder in linux (ubuntu 14.4)

Just login into your server using putty.exe

Example:

Code: Select all

sudo cp -R /home/admin/web/example.com/public_html/* /home/admin/web/examplecopy.com/public_html
The cp (CoPy) command will copy any files you specify. The cp -r command will copy any directories you specify.

Hope it help you.

arnlweb
Site Admin
Posts: 95
Joined: Wed Jun 22, 2016 1:28 pm
Location: India
Contact:

Re: How to copy folder in linux?

Post by arnlweb » Sun Jun 26, 2016 11:54 am

Also, do not forget to change file permission and ownership.

You may run this both cmd.

File Permissions:

# sudo chmod -R 755 /home/admin/web/examplecopy.com/public_html/

Change Ownership:

# sudo chown -R admin:admin /home/admin/web/examplecopy.com/public_html/

Post Reply