English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Linux egrep 명령어

Linux 명령어大全

Linux egrep 명령어는 파일 내에서 특정 문자열을 찾는 데 사용됩니다。

egrep 실행 결과는 "grep-E"유사하게, 사용되는 문법 및 파라미터는 grep 명령어를 참조할 수 있습니다. grep과의 차이점은 문자열 해석 방법입니다。

egrep는 extended regular expression 문법으로 해석되며 grep은 basic regular expression 문법으로 해석됩니다. extended regular expression는 basic regular expression보다 표준화된 표현을 사용합니다。

문법

egrep [템플릿 모드] [파일 또는 디렉토리]

파라미터 설명:

  • [템플릿 모드] : 찾으려는 문자열 규칙。

  • [파일 또는 디렉토리] : 찾으려는 목표 파일 또는 디렉토리。

온라인 예제

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

egrep Linux *

결과는 다음과 같습니다:

$ egrep Linux * #현재 디렉토리에 문자 “Linux”를 포함한 파일 찾기  
testfile:hello Linux! #다음 다섯行为 testfile 중 Linux 문자를 포함한 행  
testfile:Linux is a free Unix-운영 체제 입력.  
testfile:This is a Linux testfile!  
testfile:Linux  
testfile:Linux  
testfile1:helLinux! #다음 두行为 testfile1Linux 문자를 포함한 행  
testfile1:This a Linux testfile!  
#다음 두行为 testfile_2 Linux 문자를 포함한 행  
testfile_2:Linux is a free unix-운영 체제 입력.  
testfile_2:Linux test  
xx00:hello Linux! #xx00 Linux 문자를 포함한 행  
xx01:Linux is a free Unix-운영 체제 입력. #다음 세行为 xx01Linux 문자를 포함한 행  
xx01:This is a Linux testfile!  
xx01:Linux

Linux 명령어大全