• 企业400电话
  • 网络优化推广
  • AI电话机器人
  • 呼叫中心
  • 全 部 栏 目

    网站建设 商标✡知产 微网小程序 电商运营 彩铃•短信 增值拓展业务
    linux find命令忽略目录的查找方法
    POST TIME:2021-10-20 10:44

    在linux操作系统中,find命令非常强大,在文件与目录的查找方面可谓无所不至其极,如果能结合xargs命令使得,更是强大无比。

    以下来看看find命令忽略目录查找的用法吧。

    例1,根据文件属性查找:


    复制代码
    代码如下:

    find . -type f -name "*config*" ! -path "./tmp/*" ! -path "./scripts/*" ! -path "./node_modules/*"
    Explanation:
    find . - Start find from current working directory (recursively by default)
    -type f - Specify to find that you only want files in the results
    -name "*_peaks.bed" - Look for files with the name ending in _peaks.bed
    ! -path "./tmp/*" - Exclude all results whose path starts with ./tmp/
    ! -path "./scripts/*" - Also exclude all results whose path starts with ./scripts/

    例2,根据文件内容查找:


    复制代码
    代码如下:

    grep -n -r --exclude-dir='node_modules' --exclude-dir='logs' --exclude="nohup.out" 192 *


    当前大家也可以参考这篇文章:linux find命令忽略某个或多个子目录的实例

    上一篇:linux find命令忽略某个或多个子目录的实例
    下一篇:linux nohup命令使程序在后台运行的方法
  • 相关文章
  • 

    关于我们 | 付款方式 | 荣誉资质 | 业务提交 | 代理合作


    © 2016-2020 巨人网络通讯

    时间:9:00-21:00 (节假日不休)

    地址:江苏信息产业基地11号楼四层

    《增值电信业务经营许可证》 苏B2-20120278

    X

    截屏,微信识别二维码

    微信号:veteran88

    (点击微信号复制,添加好友)

     打开微信