手机
当前位置:查字典教程网 >操作系统 >unix linux >linux find命令忽略目录的查找方法
linux find命令忽略目录的查找方法
摘要:在linux操作系统中,find命令非常强大,在文件与目录的查找方面可谓无所不至其极,如果能结合xargs命令使得,更是强大无比。以下来看看...

在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 svn客户端使用方法介绍

Linux中文件查找方法大全

linux sort命令参数及用法详解

linux 用yum命令安装mysql的步骤分享

Linux lsof 命令使用详细说明

linux命令行修改IP的2个方法

linux top命令参数

Linux下ps命令详解 Linux下ps命令的详细使用方法

Linux系统下获取主板信息的方法

Linux rm 命令误删文件的恢复方法

精品推荐
分类导航