linux 当想在文档中查找多个单词的时候。可以使用grep命令。
exp:
a.c:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
grep -e stdlib -e stdio a.c
grep -e ‘stdlib|stdio’ a.c
grep ‘stdlib|stdio’ a.c
grep -E ‘stdlib|stdio’ a.c
egrep ‘stdlib|stdio’ a.c
–
#include <stdio.h>
#include <stdlib.h>
egrep 相当于grep -E