您现在的位置是:网站首页> 编程资料编程资料
linux find命令忽略目录的查找方法_LINUX_操作系统_
2024-02-10
130人已围观
简介 linux find命令忽略目录的查找方法_LINUX_操作系统_
在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_操作系统_
- find命令实例 linux日志定期迁移实现方法_LINUX_操作系统_
- Linux find命令实例教程 15个find命令用法_LINUX_操作系统_
- Linux下安装VMware Tools 的方法_LINUX_操作系统_
- 企业级Linux!CentOS 7.0.1406正式版发布_LINUX_操作系统_
- Linux下设置可使用netpas网络加速器的方法与步骤介绍_LINUX_操作系统_
- Linux系统忘记root密码的解决方法(简明教程)_LINUX_操作系统_
- Linux实现查看组是否包括指定用户名的命令_LINUX_操作系统_
- 刀塔传奇6月签到英雄暗影萨满属性分析_手机游戏_游戏攻略_
- 梦幻西游手游六月情谊礼包兑换码领取攻略_手机游戏_游戏攻略_
