- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- what is a good command to copy the directory,
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2004 06:38 AM
11-03-2004 06:38 AM
thanks,
Roger
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2004 06:41 AM
11-03-2004 06:41 AM
Re: what is a good command to copy the directory,
You could possibly create something with a combination of 'find . -type d', mkdir and chmod/chown.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2004 06:42 AM
11-03-2004 06:42 AM
Re: what is a good command to copy the directory,
Okay - find them all first:
for DIR in `find /home -type d -print`
do
mkdir -p /newdir/$DIR
done
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2004 06:44 AM
11-03-2004 06:44 AM
Re: what is a good command to copy the directory,
find ./srcdir -type d |cpio -pdvmu /tgtdir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2004 06:46 AM
11-03-2004 06:46 AM
Re: what is a good command to copy the directory,
On system1
find . â type d â print | pax â w â d â p o â f /root/dir-structure
On system2
Copy the file /root/dir-structure from system1 and execute
# pax -rv -p o /root/dir-structure
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2004 06:47 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2004 07:33 AM
11-03-2004 07:33 AM
Re: what is a good command to copy the directory,
cd
find . -depth | cpio -pmuldv
"cpio pmudl" is how I remember it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2004 11:03 AM
11-03-2004 11:03 AM
Re: what is a good command to copy the directory,
yet another option:
cd to target,
find -d,
cut off leading char(acters)
feed to mkdir.
For exameple:
find /var/opt -type d | cut -b 6- | xargs mkdir
(relatively) safe way to clean up after experiments:
find
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2004 05:51 PM
11-03-2004 05:51 PM
Re: what is a good command to copy the directory,
Why are u all making things complex..
Try cp -R
That's it..Read "man cp"
regrads,
sree
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2004 06:21 PM
11-03-2004 06:21 PM
Re: what is a good command to copy the directory,
I missed some thing...
After cp command
run rm `find .`
regards,
sree
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2004 08:01 PM
11-03-2004 08:01 PM
Re: what is a good command to copy the directory,
I think u didn't understand Hanry's question.He don't want to copy the files under the child directories,need to copy the directory structure only.
#cp -R won't serve the purpose.
regards
SK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2004 03:17 AM
11-04-2004 03:17 AM
Re: what is a good command to copy the directory,
Believe me, PAX is the way to go. With all those find and mkdirs, you sure can duplicate the directory hierarchy. But it takes some more scripting to keep the ownership also the access permissions.
- Sundar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2004 03:23 AM
11-04-2004 03:23 AM
Re: what is a good command to copy the directory,
DESCRIPTION
The pax command extracts and writes member files of archive files;
writes lists of the member files of archives; and copies directory
hierarchies.
Rgds...Geoff