Hi
I have a dir that has a lot of log files, one from every hour. I would like to count how many logfiles with the same start of the name.
This is how the files look.
hildir-20071125_230704
hildir-20071126_000702
hildir-20071126_010702
hildir-20071126_020706
hildir-20071126_030704
hildir-20071126_040702
elwood-20071126_010708
elwood-20071126_020703
elwood-20071126_030705
elwood-20071126_040704
elwood-20071126_050704
So the result of this should be
hildir 6
elwood 5
I should mention that there are in fact a lot more files
> ls|grep hildir|wc -l
9298
Any boddy have any good ideers?
/lhg
I have a dir that has a lot of log files, one from every hour. I would like to count how many logfiles with the same start of the name.
This is how the files look.
hildir-20071125_230704
hildir-20071126_000702
hildir-20071126_010702
hildir-20071126_020706
hildir-20071126_030704
hildir-20071126_040702
elwood-20071126_010708
elwood-20071126_020703
elwood-20071126_030705
elwood-20071126_040704
elwood-20071126_050704
So the result of this should be
hildir 6
elwood 5
I should mention that there are in fact a lot more files
> ls|grep hildir|wc -l
9298
Any boddy have any good ideers?
/lhg