linux-在指定路径下查询文件夹是否存在

我们常常在Linux下去查找文件

find / -name 'test.py'   # 在根目录下查找名为test.py的文件

但是如果用查找文件的方式去查找文件夹的话,是查不到的

find / -maxdepth 1 -type d  -name 'test_dictionary'  # -maxdepth表示搜索深度。-type表示搜索类型。

查找成功返回相应路径

猜你喜欢

转载自www.cnblogs.com/lutt/p/12037498.html
今日推荐