hax*_*ode 6 linux shell sh find
假设我需要找到这条路径/<some_where_in_root>/find/this/path,而我拥有的唯一信息是/find/this/path. 找到完整目录的最佳方法是什么?
我基本上有一个创建目录的程序,在创建目录后,我想查看创建的目录中现在是否存在路径。
到目前为止,我已经尝试过,find . -type d -name "/find/this/path"但这显然解释/find/this/path为一个字符串。在这种情况下有什么方法可以使用 find 吗?最好只解析我拥有的路径并获取该path部分并对该字符串进行搜索?
您需要使用-path或-ipath通配符
find . -type d -ipath "*/find/this/path"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1955 次 |
| 最近记录: |