We are assuming that you have successfully created a new web hosting account.

We also assume that you have logged in to your brand-new cPanel hosting panel interface.

 

With these done, scroll to the Files section and click on the File Manager icon.

Select the files you want to copy.

Please note that it is impossible to create a copy of an item with the same name within the same folder.

Select the Copy option from the toolbar at the top of the interface.

You can also right-click and select Copy from the menu.

When the interface appears, enter the file path where you want to save the item in the "Enter the file path that you want to copy this file to:" text box.

Finally, click Copy File(s) to copy the files to the location.

 

Command-Line

To do that using the command line (the following will send you a prompt before overwriting):

cp -i $fileName1

 

Say you want to copy the contents of contact.html file to /about/contact-us.html file, you can use the following command:

cp -i contact.html /about/contact-us.html

 

To copy only .php files to another location (public_html/about):

cp -i *.php public_html/about

 

To copy multiple files to a destination dir, list them separated by space – the last path given will be treated as the destination:

cp -i filename1.txt filename2.txt public_html/about

 

To copy a directory and its contents, use the -R (recursive) flag:

cp -iR public_html/legal public_html/about

 

To copy all of the files and directories in the source directory to another directory you can use a wildcard (*):

cp -iR public_html/legal/* public_html/about

 

If using "man cp" doesn't give you the confidence you need to accomplish your copying task, use the "cp code generator" at Rapidtables.com

Was this answer helpful? 0 Users Found This Useful (0 Votes)