Operating System - HP-UX
1826724 Members
3114 Online
109702 Solutions
New Discussion

Re: how to copy multiple directories?

 
sokolova
Advisor

how to copy multiple directories?

command to how to copy multiple directories in hpux?
8 REPLIES 8
Dennis Handly
Acclaimed Contributor

Re: how to copy multiple directories?

Copy them to where?
You can use cp -r dir1 dir2 ... target_dir
Yogeeraj_1
Honored Contributor

Re: how to copy multiple directories?

hi,

As mentioned by Dennis, we need more clarifications. From where to where?

to preserve the permissions, you will have to also include the "-p" switch.

for more information, see: man cp

Are there any symbolic links in these directories?

revert.

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Sajjad Sahir
Honored Contributor

Re: how to copy multiple directories?

u can use cp -r command
Steven Schweda
Honored Contributor

Re: how to copy multiple directories?

I'm mystified. Why do people recommend
"cp -r" for this task?

http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1203742

Given an adequate "tar" program, a "tar"
pipeline can do a much better job.
Bob E Campbell
Honored Contributor

Re: how to copy multiple directories?

Hey, this is Unix! There are plenty of ways to do anything! You have already had some of them. My favorite is good old find + cpio.

# find /dir1 /dir2 /dir3 -print |\
cpio -pdvlmx /newDir

Read the find and cpio man pages. Lots of control options. Overkill, sure! But isn't that what Unix is all about ;-)
Steven Schweda
Honored Contributor

Re: how to copy multiple directories?

> Hey, this is Unix! There are plenty of ways
> to do anything! [...]

Not all equally good, however.
Bob E Campbell
Honored Contributor

Re: how to copy multiple directories?

> Not all equally good ...

True, some are much funnier than others :-)
James R. Ferguson
Acclaimed Contributor

Re: how to copy multiple directories?

Hi:

> Not all equally good, however.

...and some will puzzle the uninitiated more than others...especially if one doesn't care to read the manpages :-)

Then again, the philosophy is to do whatever you tell it (or not) to do...

Regards!

...JRF...