Linux cp command

cp command is used to copy files and folders. The structure is the following:
cp <options> <source1> <source2> <source3>... <destination>

This are some of the most useful option:

  • -R
    recursive, will copy also internal directories and their contents.
    Without this option, cp by default will skip on internal directories.
  • -a 
    archiving, when copy files and directories, also copy their attributes, including ownership and permission. By default cp will take the default attribute of the user.
  • -i
    interactive, before overwriting, will ask for permission.
  • -u
    update, will copy the file only if it is doesn’t exist in the destination or newer than the destination.
  • -v
    verbose, display informative information.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s