Solved

Is there a Linux version of xcopy

Posted on 2014-11-19
2
166 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
2 Comments
 
LVL 37

Assisted Solution

by:Neil Russell
Neil Russell earned 250 total points
Comment Utility
$ 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
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now