Solved

Is there a Linux version of xcopy

Posted on 2014-11-19
2
218 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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
awk sed 8 105
I NEED A "BARE" LINUX ... 9 89
Looking for a program called HoneyMine. 3 65
Centos 7 DNS server not replying to clients 3 55
Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

756 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