shell中find查询目录下的所有文件

find /opt/test -type f -print

[root@localhost ~]# find /opt/test -type f -print |  awk '{match($0,"/test");print substr($0,RSTART)}'
/test/a/c.txt
/test/a/b.txt
/test/c/c.txt
/test/b/b.txt
/test/b/c.txt
[root@localhost ~]# find /opt/test -type f -print
/opt/test/a/c.txt
/opt/test/a/b.txt
/opt/test/c/c.txt
/opt/test/b/b.txt
/opt/test/b/c.txt

おすすめ

転載: blog.csdn.net/qq_44379042/article/details/120550382