I want to sort recursively found non-empty .py files (from current directory) in reverse order, based on the non-empty lines. If multiple files have equal number of non-blank lines, than the order should be alphabetical. All i have is:
find -P . -name '*.py' ! size 0 -print | xargs cat | sed '/^\s*$/d' | wc -l
But this is not working and I don't know how to sort. I would prefer a one-liner instead of a bash script. Thank you in advance