I am trying to summarise the file extensions in a directory recursively.
find .| xargs -d "\n" -I@ echo "${@##.*}" | sort |uniq -c
But this is giving me a series of blank lines. Not what I wanted.
I am aware of:
find . -type f | sed 's/.*\.//' | sort | uniq -c from a similar question, but am curious about why my formulation doesn't work.
-bash: /usr/bin/file: Argument list too longfilecommand is taking too long, I'd revert to extension-based type.find . -type f -exec file --brief --mime-type {} \; | sort | uniq -cshould do. Your code also works if you use aforloop, e.g. forf in **/*; do...cutsortanduniq? The commands seems to be meaningless in providing correct output for cut and sort. If you would please provide example of the desired output this will be very helpful for us to help