Solved

Is there a Linux version of xcopy

Posted on 2014-11-19
2
230 Views
Last Modified: 2014-11-20
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
Comment
Question by:Anthony Lucia
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 37

Assisted Solution

by:Neil Russell
Neil Russell earned 250 total points
ID: 40453238
$ cp -r  /source/*.* /destination

See MAN page of cp for full help details

$ man cp
0
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 250 total points
ID: 40453336
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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question