简体   繁体   中英

How to list files in all directories in search (find) result?

I have a list of directories from the result of a search:

$ find . -name dir
./dir1
./dir1/dir1.1
./dir2

How can I ls all this directories at the same time?

Use the -R flag.

user@box:~$ ls -R

You can see all of the other flags here .

将您的命令xargs lsxargs ls

find . -name dir | xargs ls

You can use these commands to do such:

1) find . -name "dir*" -exec ls {} \\; find . -name "dir*" -exec ls {} \\;

2) find . -name "dir*" | xargs ls find . -name "dir*" | xargs ls

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM