comp.unix.programmer

Re: effective way to scan directory on UNIX


>>>>> Alona Rossen <alona.rossen_at_gmail.com> writes:
[Assuming that Shell is to be involved in the solution, I
cross-post to comp.unix.shell. Please follow-up there if so.]
> Is there an effective way to scan directory, including subfolders,
> and collect file metadata on UNIX? The method should be much more
> efficient than using 'ls' command.
Depending on which metadata is to be recorded, find(1) may or
may not be useful. Like:
$ find /tmp/ -printf %m\\t%t\\t%p\\n
1777 Fri Oct 7 22:50:40.0745533298 2011 /tmp/
600 Fri Oct 7 22:50:40.0745533298 2011 /tmp/emacsX1HFu1
700 Thu Oct 6 23:40:50.0714593041 2011 /tmp/lynxXXXXb7cDqS
600 Thu Oct 6 23:40:50.0714593041 2011 /tmp/lynxXXXXb7cDqS/L20097-2715TMP.html
> We have a scenario when we have several hundreds of million files
> located in a directory tree of any complexity.
Though such a huge number of files looks like a problem by
itself.
> Any directory/ subdirectory may include any number of files, from 0
> to millions.
--
FSF associate member #7257




Written by Ivan Shmakov 07/10/2011 22.53.36
Check some pics on this site!
23/05/2012 22.39.39