bt707
asked on
File search
I have a directory on a solaris box that has about 15 sub directorys in it, In the sub directorys the files go from a few hundred to 100K, this is mail folders so the numbers change regularly.
I need a command or script that will tell me the totoal number of files that is in each directory and the total number of files that is in all of them, also which files is the 10 or 15 oldest files.
Ex:
ls /mailqueue
01 02 03 04 05 06 07 08 09 ect, ect
Thanks
I need a command or script that will tell me the totoal number of files that is in each directory and the total number of files that is in all of them, also which files is the 10 or 15 oldest files.
Ex:
ls /mailqueue
01 02 03 04 05 06 07 08 09 ect, ect
Thanks
ASKER
those two worked great but the main thing is I need to find witch file in the sub directories is the oldest file, would like to find the oldest 10 files but the one that is the oldest would do.
Thanks,
Thanks,
ASKER
also when i run this command
find <path to direcotry> -type -f | wc -l
it tells me how many sub directories is in the main directory, i'd like to find the total number of files in all the sub directories together.
Thanks agian
find <path to direcotry> -type -f | wc -l
it tells me how many sub directories is in the main directory, i'd like to find the total number of files in all the sub directories together.
Thanks agian
> find <path to direcotry> -type -f | wc -l
^^
Oops, there is a typo. Should be
find <path to direcotry> -type f | wc -l
Wesly
^^
Oops, there is a typo. Should be
find <path to direcotry> -type f | wc -l
Wesly
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks, all of these worked as good as you get.
Thanks again
Thanks again
for dirs in `find <path to direcotry> -type d -depth` ; do echo $dirs; ls -Al $dirs | wc -l; done
> the total number of files that is in all of them
find <path to direcotry> -type -f | wc -l
Wesly