zoukankan      html  css  js  c++  java
  • find : find命令详解

    find : find命令详解

    find

    解释:find - search for files in a directory hierarchy
    用法:Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]

    find /server/scripts/ --查找显示 绝对路径文件

    [root@zabbix scripts]# find /server/scripts/
    /server/scripts/
    /server/scripts/test1.sh
    /server/scripts/1
    /server/scripts/c_args.sh
    /server/scripts/c_vars.sh
    /server/scripts/c_read.sh
    /server/scripts/aa
    /server/scripts/lamp.sh
    /server/scripts/menu.sh
    /server/scripts/judge_system_mem.sh
    /server/scripts/check_web.sh
    /server/scripts/com_if.sh
    

    find /server/scripts/ |xargs md5sum -- 批量处理文件

    要执行时,只需要交给bash就可以:find /server/scripts/ |xargs md5sum|bash

    [root@zabbix scripts]# find /server/scripts/ |xargs md5sum 
    md5sum: /server/scripts/: Is a directory
    9d2de0fe1d6a415e87656e0b7aeeabff  /server/scripts/test1.sh
    d41d8cd98f00b204e9800998ecf8427e  /server/scripts/1
    738a54bab35dc027e6a8a5d82ef3ba6f  /server/scripts/c_args.sh
    738a54bab35dc027e6a8a5d82ef3ba6f  /server/scripts/c_vars.sh
    5f6295bdaa1e2ca989ddedb8f8cdc77d  /server/scripts/c_read.sh
    597df6cb3d430e5bb276cf18bd2112f1  /server/scripts/aa
    9f8af9a257536cb1e41e48df6e98a100  /server/scripts/lamp.sh
    eaf58b51850ea72c8ac0a85179a075fd  /server/scripts/menu.sh
    8462deda79cb774f7b6a43dd320a26b8  /server/scripts/judge_system_mem.sh
    ec5552fa6189bad44ecf16e134cf4f42  /server/scripts/check_web.sh
    3fc2f7cd9d5f5743a9a967b4fb44a1bb  /server/scripts/com_if.sh
    

    find /server/scripts/ -name

    [root@zabbix scripts]# find /server/scripts/ -name "test1.sh"
    /server/scripts/test1.sh
    [root@zabbix scripts]# find /server/scripts/ -name "*t*.sh*"
    /server/scripts/test1.sh
    /server/scripts/judge_system_mem.sh
    

    find /server/scripts/ -type

    参数-type x文件类型

    1. -type f --文件
    2. -type d --目录
    3. -type s --...
    [root@zabbix scripts]# find /server/scripts/ -type d
    /server/scripts/
    /server/scripts/moox
    
  • 相关阅读:
    kakfa 安全机制
    配置管理
    消费者基本操作
    生产者基本操作
    笔记:类加载器
    主题管理
    记一次学习SpringCloud将zk作为注册中心的bug
    JVM新生代进入老年代、何时触发Full GC?
    JVM调优
    线程池
  • 原文地址:https://www.cnblogs.com/moox/p/12808037.html
Copyright © 2011-2022 走看看