RSS Subscription
Linux Howtos & Tutorials

Enter your email:

Delivered by


NOTE:New tutorials are from LinuxCareer.com

Poll

Do you own or wish to have iPhone?
 


Linux eBooks FREE Download
A guide to programming Linux kernel modules
Introduction to Linux - A Hands on Guide
A Newbie's Getting Started Guide to Linux

Linux from Scratch - Create Your Own Linux System - Free eBook

Linux: The Hacking Solution (v.3.0)

SQLite 3 with PHP Essential Training – Free Video Training Tutorials

This guide will introduce you to the world of GNU/Linux

The GNU/Linux Advanced Administration

A Complete Beginner's Manual for Ubuntu 10.04 (Lucid Lynx)

Advanced Bash-Scripting Guide

Set up, maintain, and secure a small office email server

Partner Linux Sites:
How-To.LinuxCareer.com
Jobs.LinuxCareer.com
TuxMachines
Monsterb
LinuxBloggers
AdamsInfo
LinuxScrew
All For Linux

cp

Article Index
1. Name
2. Synopsis
3. Frequently used options
4. Examples

1. Name

cp [man page] - copy files and directories

2. Synopsis

cp [OPTION]... [-T] SOURCE DEST
cp [OPTION]... SOURCE... DIRECTORY
cp [OPTION]... -t DIRECTORY SOURCE...

3. Frequently used options

-i, --interactive
prompt before overwrite
-p same as --preserve=mode,ownership,timestamps
-R, -r, --recursive
copy directories recursively
-v, --verbose explain what is being done

4. Examples

Copy directory dir2 and its content into directory dir1:

cp -r dir2/ dir1/ 

Copy directory dir2 including its content
Copy all files from dir2 to dir1:

cp dir2/* dir1/ 

Copy all files
Copy file1 from dir1 to dir2 but prompt before overwrite:

cp -i dir1/file1 dir2/ 

Copy all files and prompt before overwrite
Copy file1 from dir1 to dir2 and preserve mode,ownership and timestamps:

cp -p dir1/file1 dir2/ 

copy file and preserve mode,ownership and timestamps

Share this linux post:

Submit cp in Delicious Submit cp in Digg Submit cp in FaceBook Submit cp in Google Bookmarks Submit cp in Stumbleupon Submit cp in Technorati Submit cp in Twitter
 
Comments for this page are closed !!!
Please visit our new Linux Forum for additional help or discussion.


Linux eBooks FREE Download