Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!snorkelwacker!bloom-beacon!athena.mit.edu!jik From: jik@athena.mit.edu (Jonathan I. Kamens) Newsgroups: comp.unix.questions Subject: Re: find (too many arguments) Message-ID: <1990Jan11.075156.6864@athena.mit.edu> Date: 11 Jan 90 07:51:56 GMT References: <388@usdtsg.Dayton.NCR.COM> <22002@adm.BRL.MIL> Sender: news@athena.mit.edu (News system) Reply-To: jik@athena.mit.edu (Jonathan I. Kamens) Organization: Massachusetts Institute of Technology Lines: 29 In article <388@usdtsg.Dayton.NCR.COM>, musson@usdtsg.Dayton.NCR.COM (Scott Musson) writes: > when I do a 'find p* -mtime +1 -print' in a directory with a large number of > files starting with 'p', I get find: too many arguments. > > I can subdivide the list with smaller segments of the files I want to find, > but I would like another way around this if possible. Can anyone point me > in the right direction? There is no way around it. The shell has a built-in limit on the number of arguments that can be parsed on the command line. Furthermore, there is a kernel limit on the number of arguments passed into any particular program execution. You'll have to do your finding by breaking it up into smaller sets of files. I cannot resist pointing out that any directory that has so many files into it that they can't be passed into find probably has too many files in it and should be reorganized :-). Seriously, if the directory in question has no subdirectories, (or if you want it to search the subdirectories too), you could do "find . -name p\* -mtime +1 -print", which solves the problem. Jonathan Kamens USnail: MIT Project Athena 11 Ashford Terrace jik@Athena.MIT.EDU Allston, MA 02134 Office: 617-253-8495 Home: 617-782-0710