【问题标题】:Show and count all file extensions in directory (with subdirectories)显示和计算目录中的所有文件扩展名(带有子目录)
【发布时间】:2015-08-07 05:02:00
【问题描述】:

我正在使用来自this 主题的命令来查看目录和所有子目录中的所有文件扩展名。

find . -type f -name '*.*' | sed 's|.*\.||' | sort -u

我如何计算每个扩展的出现次数?

喜欢:

png: 140

【问题讨论】:

    标签: bash


    【解决方案1】:

    像这样,使用 uniq-c, --count 标志:

    find . -type f -name '*.*' | sed 's|.*\.||' | sort | uniq -c
    

    【讨论】:

    • 干杯伙伴!这正是我想要的。
    猜你喜欢
    • 2017-05-09
    • 1970-01-01
    • 2021-09-18
    • 1970-01-01
    • 2012-05-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多