Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有什么方法可以让file命令从中获取输入stdin?具体来说,我正在尝试获取存档中文件的文件类型,并尝试在单个命令中完成。我试过这个:
file
stdin
ar -p foo.a baz.o | file
但这不起作用。
使用file -. 连字符的意思是“从标准输入中获取输入”。
file -
试试这个:
ar -p foo.a baz.o | xargs 文件