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.
我有一个搜索结果的目录列表:
$查找。-name 目录 ./dir1 ./dir1/dir1.1 ./dir2
我怎样才能同时ls所有这些目录?
使用 -R 标志。
user@box:~$ ls -R
您可以在此处查看所有其他标志。
将您的命令输入xargs ls:
xargs ls
find . -name dir | xargs ls
您可以使用这些命令来执行此操作:
1)find . -name "dir*" -exec ls {} \;
find . -name "dir*" -exec ls {} \;
2)find . -name "dir*" | xargs ls
find . -name "dir*" | xargs ls