`

find 进阶用法

F# 
阅读更多
指定深度
-H 3

查找当前目录内的文件(-type f)或文件夹(-type d),并按照原始目录结构复制到另一目录
find fromDir -iname "filename" -type d -exec cp -fr {} toDir/{} \;


类似的删除特定目录下的所有特定文件夹
find fromDir -iname "filename" -type d -exec rm -fr {} \;


列出指定目录及子目录包含特定字符串的所有文件名
find fromDir -iname "filename" -type f -exec grep "string" {} \; -print
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics