| | |
How to use find to handle large number of files
![]() |
•
•
Join Date: Nov 2007
Posts: 8
Reputation:
Solved Threads: 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:
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.
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...
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
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
Last edited by Gromit; Oct 15th, 2008 at 11:50 am.
![]() |
Similar Threads
- Binary File IO (C#)
- File Transfering service (Java)
- fstream Tutorial (C++)
- Cannot find server or DNS Error - please help! (Viruses, Spyware and other Nasties)
- memory management in wndows 2000 (Windows NT / 2000 / XP)
- Synchronize Outlook with Entourage (Mac Software)
- Using Global Low-Level Hooks Without Using A Dll (Computer Science)
- Do you need AV and Firewall? (Windows NT / 2000 / XP)
Other Threads in the Getting Started and Choosing a Distro Forum
- Previous Thread: Suse10.1 crash
- Next Thread: Folder corresponding to windows!
Views: 1316 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for Getting Started and Choosing a Distro
age-related android baremetal chrome cio cloud cloudcomputing code commercial computers crystalballsunday desktop developers development distributions distro dsl elderly embedded filesystems forums google http://expertcore.org/ innovations jauntyjackalope joe_brockmeier kernel library linus linux microsoft multi-core netgear newbies novell openoffice.org opensuse open_source operating operatingsystems parallel performance processing redhat routers smp solaris studios system systembuilders systemintegrators terminalservices thecloud thinclients tools ubuntu users virtualization vmware webbased wikis windows xenon





