3 ms·
I'd probably just do it with existing commands (pipe split across multiple lines to make it easier to read): find . -type f -name '*.txt' -print0 | xargs -
by tzs 6y ago
I'd probably just do it with existing commands (pipe split across multiple lines to make it easier to read):
find . -type f -name '*.txt' -print0
| xargs -0 cat | tr ' \t' '\n\n' | grep '\S'
| sort | uniq -c | sort -nr | sed 10q
I'm assuming that when it says find all the .txt files in subdirectories of the current directory, that should include .txt files in the current directory.