![](/img/trans.png)
[英]How to pipe the output of the Linux which command into the Linux file command?
[英]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.