LoginSignup
1
1

More than 5 years have passed since last update.

カレントディレクトリ以下の拡張子を数え上げる

Posted at
find . -type f \
    | perl -F"\/" -ane 'print $F[-1]' \
    | perl -F"\." -ane 'print $F[-1] if $#F > 0' \
    | sort | uniq -c | sort -n

実行すると以下の様に拡張子が集計されて
どのようなディレクトリにいるのかが短くまとまったリストで分かります。

     27 txt
     48 tif
     80 psd
     92 mp4
    163 JPG
    459 gif
   1591 jpeg
   2024 png
   3557 jpg

このサンプル例ですと、画像を保存するPictureディレクトリ以下に
何故かmp4やtxtがあることが判明します。
ls */*mp4 や ls */*txt などの次の行動に繋がります。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1