Linux ディレクトリのリスト内のファイルを再帰的にカウントするにはどうすればよいですか?
例:
/dog/
/a.txt
/b.txt
/c.ipynb
/cat/
/d.txt
/e.pdf
/f.png
/g.txt
/owl/
/h.txt
次の出力が必要です。
5 .txt
1 .pynb
1 .pdf
1 .png
次のことを試しましたが、運がありませんでした。
find . -type f | sed -n 's/..*\.//p' | sort | uniq -c