Created
June 7, 2019 05:54
-
-
Save dzc34/6f97f136a03f579790fff0205df417dd to your computer and use it in GitHub Desktop.
Shell - Chercher un texte dans des fichiers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# rechercher l'expression "texte_a_trouver" | |
# dans tous les fichiers du dossier courant et sous-dossiers | |
grep -R texte_a_trouver . | |
# pour afficher uniquement le nom des fichiers | |
# ----> 1 fichier contenant l'exression plusieurs fois, sera listé plusieurs fois | |
grep -Rl texte_a_trouver . | |
# pour afficher uniquement le nom des fichiers (sans doublons) | |
grep -R texte_a_trouver . | cut -d ':' -f1 | sort -u |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment