man find
-depth Process each directory’s contents before the directory itself.
而后查了下,暂时记录下,待整理:
参数-depth 的意思是:在处理目录之前首先处理目录下的子内容。oracle
也便是说在不加-depth的时候, 处理顺序是首先处理目录自己,而后处理目录下的子内容。加不加-depth参数,会影响输出结构的输出顺序。
-------------------------------------------------------------
例以下面的两个命令,输出结果是相反的:
先输出子内容,再输出上层目录内容,直到最顶层:
[oracle@oracledb ~]$ find test -depth ! -empty
test/test1/test2/test3
test/test1/test2
test/test1
test
先输出顶层目录,再输出下面的各层子目录内容,直到最低层:
[oracle@oracledb ~]$ find test ! -empty
test
test/test1
test/test1/test2
test/test1/test2/test3ide