我已经运行了一个命令,在服务器上的文件中find一个string,如下所示:
cd / grep -r "string to be found" *
服务器返回这样的结果
Binary file dev/disk/by-path/pci-0000:00:10.0-scsi-0:0:0:0-part1 matches Binary file dev/disk/by-path/pci-0000:00:10.0-scsi-0:0:0:0 matches
据我所知,这些是保存在RAIDarrays上的实际存储的文件(请纠正我,如果我错了)。 我怎样才能find我的比赛所在的位置?
有没有更快的解决scheme比运行“grep”所有服务器的文件?
感谢您的时间!
一般在二进制文件中,你必须做一些事情:
$ string /binary/file | grep -i whatuwant
但如果你想要search文本文件,我的build议是:
$ find / -type f -exec grep -i whatuwant '{}' ';'