码迷,mamicode.com
首页 > 其他好文 > 详细

find : find命令详解

时间:2020-04-30 13:24:30      阅读:247      评论:0      收藏:0      [点我收藏+]

标签:pts   find命令详解   ssi   read   显示   exec   amp   scripts   check   

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

find : find命令详解

标签:pts   find命令详解   ssi   read   显示   exec   amp   scripts   check   

原文地址:https://www.cnblogs.com/moox/p/12808037.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!