管道找到`file`(命令)linux命令递归

时间:2016-12-13 21:17:17

标签: linux bash file recursion

我的文件系统看起来与未知文件类型相似。

└── 63206
    └── 4443606
        ├── 6433
        ├── 712861
        ├── 726355
        └── 723714

对于每个文件,我都可以执行file <filename>并获取有关其尺寸的规范。

6433: PNG image data, 138 x 209, 8-bit/color RGBA, non-interlaced

有人能告诉我如何以递归的方式管道这个,所以我可以为bash中的每个文件路径得到这样的输出吗?

我试过像find | file这样的东西。我不熟悉管道bash。

1 个答案:

答案 0 :(得分:4)

你可能想要添加其他条件,但基本上是从顶级目录

find -type f -exec file {} \;

find path_to_dir -type f -exec file {} \;