Hi all;

I'm having problem with find command in listing large number of files in the current directory.

This is the code that i use:

find *.dat -prune | xargs ls -ltr

This command cannot handle large number of files and throwing this error msg:
ksh: /usr/bin/find: 0403-027 The parameter list is too long.

Someone please help, i really need it urgently. Thank you in advance.

Try using the built in exec command! Also, not sure if that's exactly what you're typing, but you'll need to give "find" a few more arguments... find . -iname *.dat -prune -exec ls -ltr {}\; What this does, bit by bit:

find - the command!

. - the starting point, in this case the cwd

-iname - we want stuff named x, and we dont' care about case (i = insensitive)

*.dat - this is the "x" we were talking about

-exec - execute this command on what we find!

-prune - prune stuff!

ls -ltr - this is the command to execute

{} - this get substited with the find results when the command is run

\; - end of exec statement

I hope this helps!

-G

P.S. I think you need to use "-depth" for prune to do what you want

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.