On Thu, Dec 27, 2001 at 10:20:59AM -0500, David A. Bandel wrote: >On Thu, 27 Dec 2001 19:51:45 +0800 >Chang <[EMAIL PROTECTED]> spewed into the bitstream: > >> >> 1. is it possible to have 50000 files in a directory? >> 2. how to copy it given the limit of the cp command? > >I'd use the find command: >find . -exec cp {} <dest> \;
Actually ``find . | cpio -pdumv destdir'' is usually much more efficient as it doesn't exec a cp command for each file, and it preserves the ownership, timestamps, etc. of the original file. On the other hand, 50,000 files in a single directory is probably a Very Bad Idea(tm). At one time Unix file searches were quadratic WRT the number of entries in the directory. I think this has improved with more recent file systems, but I would avoid it in any case. Bill -- INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Software LLC UUCP: camco!bill PO Box 820; 6641 E. Mercer Way FAX: (206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676 URL: http://www.celestial.com/ ``The man who produces while others dispose of his product is a slave.'' Ayn Rand _______________________________________________ Linux-users mailing list Archives, Digests, etc at http://linux.nf/mailman/listinfo/linux-users