- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- copy files from one directory to another.
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
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
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
тАО12-01-2006 03:24 AM
тАО12-01-2006 03:24 AM
copy files from one directory to another.
there are many files ,how can I use command?
thanks a lot!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-01-2006 03:28 AM
тАО12-01-2006 03:28 AM
Re: copy files from one directory to another.
It all depends on whether you want to copy all the files or just some of them and, if just some, what the selection criteria may be.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-01-2006 03:43 AM
тАО12-01-2006 03:43 AM
Re: copy files from one directory to another.
It seem "cpio" can not support files more than 2G.
Does cp -p can preserve UID and GID?
Is following right?
#find . |cp -p /data
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-01-2006 03:50 AM
тАО12-01-2006 03:50 AM
Re: copy files from one directory to another.
I would rather prefer cpio if there are multilple files to be copied.
cd /sourcedirectory
# find .|cpio -pudlmv /destinationdirectory
-USA..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-01-2006 04:02 AM
тАО12-01-2006 04:02 AM
Re: copy files from one directory to another.
> Is following right?
> #find . |cp -p /data
No, you just use cp:
cd /old-directory
cp -p * /data
If there are thousands of files in that directory, you may get a line too long message. xargs will be required in that case. If you have any dot files (files starting with .), you'll need to copy those with something like this:
cp -p * .??*
This prevents copying the .. directory. There are other special filenames you will have to handle manually such .a .b .1 .2 and so on. Be careful of expression that match ..
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-01-2006 04:08 AM
тАО12-01-2006 04:08 AM
Re: copy files from one directory to another.
If you have largefiles, I'd use 'fbackup' and 'frecover':
# cd /srcdir
# fbackup -i . -f - | (cd /dstdir; frecover -Xsrf -)
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-01-2006 08:44 AM
тАО12-01-2006 08:44 AM
Re: copy files from one directory to another.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-01-2006 10:53 AM
тАО12-01-2006 10:53 AM
Re: copy files from one directory to another.
cd /old-directory; cp -p * /data
>If there are thousands of files in that directory
Why not use "cp -pR /old-directory /new-directory"
The only issue is that new-directory can't exist. If is does, you'll have to move the files after you copy it. That should be easier than worrying about "." files. You still may have to use xargs for the mv.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-02-2006 01:48 PM
тАО12-02-2006 01:48 PM
Re: copy files from one directory to another.
cd /source_dir
tar cvf - . |ksh "(cd /destination_dir;tar xvf -)"
Regards,
Kaps