繁体   English   中英

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

[英]pipe find to `file` (command) linux command recursive

我有一个文件系统,看起来像这样,文件类型未知。

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

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

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

有人可以告诉我如何递归地传递它,以便为bash中的每个文件路径获得类似的输出吗?

我尝试过类似find | file find | file 我不熟悉管道狂欢。

您可能要添加其他条件,但基本上是从顶层目录开始

find -type f -exec file {} \;

要么

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM