为什么管道不能与 'find' 和 'ls' 一起使用如果我这样做了find . -name *foo* | ls -lah,它会执行 ls$PWD而不是 find 的输出。
find . -name *foo* | ls -lah
$PWD
然而,解决方案是find . -name *foo* | xargs -r ls -alh或可以使用 exec。
find . -name *foo* | xargs -r ls -alh
bash ls pipe xargs
bash ×1
ls ×1
pipe ×1
xargs ×1