Hello everyone,
I am using a chunk of code to display the frequency of a file name in a list of directories. The code looks like this:
find . -name "*.log" | cut -d/ -f4 | cut -d. -f1 | awk '{print $1}' | sort | uniq -c | sort -nr
The file paths would look something like this:
./clogs/20091201/2/205/54353.log
./clogs/20091201/12/201/99001.log
./clogs/20091202/2/205/54353.log
etc.
The 20091201 represents the date. Running the code would produce something like:
2 54353
1 99001
This is good but I'd like some extra information displayed as well. Specifically, the dates. Is it possible to add in the dates and have the output look like:
2 54353 20091201 20091202
1 99001 20091201
Any suggestions would be appreciated. Thanks.