Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Copying File and Directory

Copying File and Directory:

  1. Copy file:

Syntax:

# cp [source]filename [destination]

  1. Copy directory

#cp –r [source]directory [destination]

to copy a directory into another directory recursively

  1. cp –rf [source]directory [destination]

to copy a directory forcefully

syntax used for copy file or directory:

cp [option] file destination

option:

-I : interactive : ask before overwriting file

-r : Recursive

-p : Preserve

-f : forcefully

More than one file can be copied at a time if the destination is directory

Syntax:

cp [option] file1 file2 file 3 Destination



This post first appeared on RED HAT ENTERPRISE LINUX, please read the originial post: here

Share the post

Copying File and Directory

×

Subscribe to Red Hat Enterprise Linux

Get updates delivered right to your inbox!

Thank you for your subscription

×