0

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.

2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by JeoSaurus
0

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.