• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 441
  • Last Modified:

Is there a Linux version of xcopy

In WIndows, I can copy all the contents of the directory, -- and the respectivie subdirectoires with the following command

cd \dest
xcopy \src\*.* /s

With the /s allowsing the subdirectories and theri contents to be recursively copied

Is there an equivalent command for Linux ?

Thanks
0
Anthony Lucia
Asked:
Anthony Lucia
2 Solutions
 
Neil RussellTechnical Development LeadCommented:
$ cp -r  /source/*.* /destination

See MAN page of cp for full help details

$ man cp
0
 
woolmilkporcCommented:
cp can even do what xcopy cannot: preserve the original timestamp and ownership information  of the copied files!

To achieve this add the "-p" flag:

cd /dest
cp -rp /source/* .

When using *.* instead of a single * cp will only copy files whose names contain a dot!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now