Commande Linux egrep


  Résultats de traduction:

egrep

Commande Linux egrepsyntaxe

Fonction : La commande egrep est utilisée pour rechercher la chaîne spécifiée dans le fichier.

Syntaxe : egrep [Modèle de modèle] [Fichier ou répertoire]

Commande Linux egrepexemple

Affichez les caractères correspondants dans le fichier. Par exemple, pour rechercher les fichiers contenant la chaîne « Linux » dans tous les fichiers du répertoire courant, vous pouvez utiliser la commande suivante :

egrep Linux *

Les résultats sont les suivants :

$ 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

Maison

vidéos

Questions et réponses