Pra*_*Das 3 directory find macos
x
我想使用 macOS 终端在特定子目录中查找目录y
,但我不知道y
.
该命令find / -type d -name "x"
适用于查找,但系统中x
有许多命名的目录,因此我需要查找该目录下的目录。x
x
y
我试过 -
find / -type d -name "/y/x"
或者 find / -type d -name "y/x"
或者 find / -type d -name "../y/x"
但这些并没有告诉我想要的结果。
使用-path
初级:
find / -path '*y/x'
Run Code Online (Sandbox Code Playgroud)
Run Code Online (Sandbox Code Playgroud)-path pattern True if the pathname being examined matches pattern. Special shell pattern matching characters (``['', ``]'', ``*'', and ``?'') may be used as part of pattern. These characters may be matched explicitly by escaping them with a backslash (``\''). Slashes (``/'') are treated as normal characters and do not have to be matched explicitly.
归档时间: |
|
查看次数: |
3965 次 |
最近记录: |