eld*_*his 357
-maxdepth 1根据您当前的命令结构,我认为您可以使用该选项获得所需内容.如果没有,你可以尝试寻找在手册页的find.
相关条目(为方便起见):
-maxdepth levels
Descend at most levels (a non-negative integer) levels of direc-
tories below the command line arguments. `-maxdepth 0' means
only apply the tests and actions to the command line arguments.
Run Code Online (Sandbox Code Playgroud)
您的选择基本上是:
find DirsRoot/* -maxdepth 0 -type f #This does not show hidden files
Run Code Online (Sandbox Code Playgroud)
要么:
find DirsRoot/ -maxdepth 1 -type f #This does show hidden files
Run Code Online (Sandbox Code Playgroud)
sqr*_*163 17
如果您寻找符合POSIX标准的解决方案:
cd DirsRoot && find . -type f -print -o -name . -o -prune
-maxdepth不符合POSIX标准.
是的,可以通过在 find 命令中使用-maxdepth选项
find /DirsRoot/* -maxdepth 1 -type f
Run Code Online (Sandbox Code Playgroud)
来自手册
man find
-最大深度级别
下降到起始点以下的大多数级别(非负整数)目录级别。
-最大深度0
意味着仅将测试和操作应用于起点本身。
| 归档时间: |
|
| 查看次数: |
121788 次 |
| 最近记录: |