今天执行grep命令差点把服务器搞崩

grep “rst” -r ./ >> a.log
今天执行这个命令差点把服务器搞崩了。
本意是查找所有源代码文件中含有rst字符串的行,打印到文件a.log中,然后进行分析。
这句grep命令会搜索当前目录下所有的带rst字符串的行,并将结果打印到a.log中。但是,a.log本身也在当前目录下,形成了死循环回路。
更要命的是,由于源代码文件数量庞大,自以为是由于grep命令处理的文件数量过多而导致的慢,没有在意,就让它多跑了一会……导致内存不足、磁盘空间不足……悲剧产生……ssh连接服务器无法响应……

yum repolist all Repository extras is listed more than once in the configuration Repository extras is listed more than once in the configuration Repository centosplus is listed more than once in the configuration Repository PowerTools is listed more than once in the configuration Repository AppStream is listed more than once in the configuration repo id repo name status AppStream CentOS-8 - AppStream - repo.huaweicloud.com enabled BaseOS CentOS-8 - Base - repo.huaweicloud.com enabled PowerTools CentOS-8 - PowerTools - repo.huaweicloud.com enabled appstream CentOS Linux 8 - AppStream disabled appstream-source CentOS Linux 8 - AppStream - Source disabled base CentOS-8.5.2111 - Base - mirrors.aliyun.com enabled baseos CentOS Linux 8 - BaseOS disabled baseos-source CentOS Linux 8 - BaseOS - Source disabled centosplus CentOS-8 - Plus - repo.huaweicloud.com disabled cr CentOS Linux 8 - ContinuousRelease disabled debuginfo CentOS Linux 8 - Debuginfo disabled devel CentOS Linux 8 - Devel WARNING! FOR BUILDROOT USE ONLY! disabled epel Extra Packages for Enterprise Linux 8 - x86_64 enabled epel-debuginfo Extra Packages for Enterprise Linux 8 - x86_64 - Debug disabled epel-modular Extra Packages for Enterprise Linux Modular 8 - x86_64 - RETIRED disabled epel-modular-debuginfo Extra Packages for Enterprise Linux Modular 8 - x86_64 - Debug - RETIRED disabled epel-modular-source Extra Packages for Enterprise Linux Modular 8 - x86_64 - Source - RETIRED disabled epel-source Extra Packages for Enterprise Linux 8 - x86_64 - Source disabled epel-testing Extra Packages for Enterprise Linux 8 - Testing - x86_64 disabled epel-testing-debuginfo Extra Packages for Enterprise Linux 8 - Testing - x86_64 - Debug disabled epel-testing-modular Extra Packages for Enterprise Linux Modular 8 - Testing - x86_64 - RETIRED disabled epel-testing-modular-debuginfo Extra Packages for Enterprise Linux Modular 8 - Testing - x86_64 - Debug - RETIRED disabled epel-testing-modular-source Extra Packages for Enterprise Linux Modular 8 - Testing - x86_64 - Source - RETIRED disabled epel-testing-source Extra Packages for Enterprise Linux 8 - Testing - x86_64 - Source disabled extras CentOS-8 - Extras - repo.huaweicloud.com enabled extras-source CentOS Linux 8 - Extras - Source disabled fasttrack CentOS Linux 8 - FastTrack disabled ha CentOS Linux 8 - HighAvailability disabled media-appstream CentOS Linux 8 - Media - AppStream disabled media-baseos CentOS Linux 8 - Media - BaseOS disabled plus CentOS Linux 8 - Plus disabled plus-source CentOS Linux 8 - Plus - Source disabled powertools CentOS Linux 8 - PowerTools disabled powertools-source CentOS Linux 8 - PowerTools - Source disabled
06-11
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值