리눅스 egrep 명령


  번역 결과:

egrep

리눅스 egrep 명령통사론

기능: egrep 명령은 파일에서 지정된 문자열을 찾는 데 사용됩니다.

구문: ​​egrep [템플릿 패턴] [파일 또는 디렉터리]

리눅스 egrep 명령예

파일에 일치하는 문자를 표시합니다. 예를 들어 현재 디렉터리의 모든 파일에서 "Linux"라는 문자열이 포함된 파일을 찾으려면 다음 명령을 사용할 수 있습니다.

egrep Linux *

결과는 다음과 같습니다.

$ egrep Linux * #查找当前目录下包含字符串“Linux”的文件  
testfile:hello Linux! #以下五行为testfile 中包含Linux字符的行  
testfile:Linux is a free Unix-type operating system.  
testfile:This is a Linux testfile!  
testfile:Linux  
testfile:Linux  
testfile1:helLinux! 
#以下两行为testfile1中含Linux字符的行  
testfile1:This a Linux testfile!  
#以下两行为testfile_2 中包含Linux字符的行  
testfile_2:Linux is a free unix-type opterating system.  
testfile_2:Linux test  xx00:hello Linux! #xx00包含Linux字符的行  
xx01:Linux is a free Unix-type operating system. #以下三行为xx01包含Linux字符的行  
xx01:This is a Linux testfile!  
xx01:Linux

비디오

Q&A