Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I need to build a script that will move about 30,000 picture files a night(I would just wait to do it on the weekend but it would just be too many files) or so but when every I try to use the cp command it starts to copy then says there are too many arguments. Any suggestions or could I tar the files first?
You'll need to patch and recompile the kernel to really fix that.Nice article: http://www.linuxjournal.com/article.php?sid=6060
I did change the kernel as it is explained there and had no problems handling up to 150.000 files after that (didn't try out for the max).
Last edited by crashmeister; 06-09-2004 at 02:45 AM.
I think that the problem is that the filename expansion was too large. So it was a bash limitation and not a kernel file handling limitation.
The now such directory indicates a problem in the script that may need tweeking. Remember when using wild cards to manipulate files, that if it is possible that some of the files contain white-space characters, or characters such as '!({' that have special meaning to the shell, that you need to put the wild cards in double quotes.
cp "[a-fA-f]*.jpg" "${destdir}" for instance.
Limit the number of files sent to mv at a time by using the xargs -l option. (The xargs -i () syntax is explained later in the article). The following command sets a limit of 56 files at time, which mv receives:
thanks for this recommendation! This will also help when you sometimes have permissions problems and other crap break a large file transfer and you can restart it without having to start from the beginning.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.