Copying Files & Preserving the Timestamp

To copy a file from one location to another in Linux you would use the following command:
To copy all files in a folder you would use:
To copy all files and sub-folders:
To copy all files & sub-folders while preserving the file timestamps:
To copy all files & sub-folders while preserving the file timestamps and forcing overwrite:
And if the above forcing does not work in your environment, it is possible that you have an alias preventing the FORCE command from working. 
Run the "alias" command to see if you have an alias for the cp command - it would look something links this:
> alias
cp -i
To remove the alias (temporarily for the current session) you would run:
> unalias cp

<<<<<<< HEAD

Was this answer helpful?

 Print this Article

Disqus this...

comments powered by Disqus

or Comment on Facebook

  • Email, SSL
  • 3 Users Found This Useful
Was this answer helpful?
>>>>>>> v7.2.3-release.1

Related Articles

Mass File Renaming

This little snippet will help you to rename a list of files with a .xhtml extension to a .html...

CHMOD Files & Folders for Best Security in Apache

How to change file permissions in APACHE to improve security. The Objective: To recursively...

Converting a Database from latin1 to UTF-8

These instructions will work for any MySQL database installed on a Linux server.  These...

cPanel - Inbound Remote MySQL Connections

To enable a MySQL Database on a LAMP server to receive incoming connections from a remote...