linux copy command

>> Wednesday, April 1, 2009

The linux copy command go as below

cp [OPTION]... SOURCE DEST
cp [OPTION]... SOURCE... DIRECTORY
cp [OPTION]... --target-directory

The copy command is used major copy operation some them are listed below

make a backup of each existing destination file
like --backup but does not accept an argument
copy contents of special files when recursive
same as --no-dereference --preserve=link
if an existing destination file cannot be opened, remove it and try again
prompt before overwrite
follow command-line symbolic links
link files instead of copying
always follow symbolic links
same as --preserve=mode,ownership,timestamps
don't preserve the specified attributes
always make simple backups

Example
File copy
cp file1.txt newdir

File copy from directory to other
cp /home/file.txt /home/file.bak

Copy all file to different directory
cp *.txt "destination directory"

Recursive copy
cp -r /home/files/* /home/backup

0 comments:

About This Blog

Lorem Ipsum

  © Blogger templates Palm by Ourblogtemplates.com 2008

Back to TOP