私人论坛

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 827|回复: 0

linux 下搜索文件内容

[复制链接]

156

主题

303

帖子

1664

积分

新手上路

Rank: 1

积分
1664
发表于 2019-10-25 17:41:45 | 显示全部楼层 |阅读模式
可以搜索指定目录下指定扩展名文件内的内容
cd /home/wwwroot/dasuanwang
find -name '*.php' -print0|xargs -0 grep '@require_once'


搜索当前文件夹下:
grep -r -a -i "文件内容" . --include=*.php --exclude=*.htm --exclude=*.html
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|私人论坛

GMT+8, 2026-2-20 09:59 , Processed in 0.046872 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表