I have subfolders of compressed csv (.csv.gz)
files containing usernames and I'm trying to find the frequency of usernames.
The following bash pipeline gives me top users.
for subfolder in folder; do gunzip -rc $subfolder | cut -d, -f1 | sort | uniq -c | sort -nr | head; done
However, it is very slow when I have many large files in the subfolders. Is there a more efficient bash script for this purpose?
gunzip -rc
one "subfolder" at a time instead of doinggunzip -rc folder
without a loop? Also - "folder" is a Windows term, in Unix there are "directories" and "files".