我的文件系统看起来与未知文件类型相似。
└── 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。
答案 0 :(得分:4)
你可能想要添加其他条件,但基本上是从顶级目录
find -type f -exec file {} \;
或
find path_to_dir -type f -exec file {} \;