新网创想网站建设,新征程启航

为企业提供网站建设、域名注册、服务器等服务

linux中怎么利用find命令忽略目录

linux 中怎么利用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命令忽略目录
新闻来源:http://www.wjwzjz.com/article/ghhpje.html
在线咨询
服务热线
服务热线:028-86922220
TOP