« Grep » : différence entre les versions
Apparence
Page créée avec « == classique == grep -Rl "{{skin url" * ou grep -Rl "{{skin url" /rep == exclure un repertoire == grep -Rl "quetchose" * | grep -v '^unrepertoire/' grep -Rl "fwrite" *... » |
Aucun résumé des modifications |
||
| (3 versions intermédiaires par le même utilisateur non affichées) | |||
| Ligne 1 : | Ligne 1 : | ||
== classique == | == classique == | ||
<syntaxhighlight lang="bash" line copy> | |||
grep -Rl "{{skin url" * ou grep -Rl "{{skin url" /rep | |||
</syntaxhighlight> | |||
== exclure un repertoire == | |||
<syntaxhighlight lang="bash" line> | |||
grep -Rl "quetchose" * | grep -v '^unrepertoire/' | |||
grep -Rl "fwrite" * | grep -v '^unrepertoire/' | grep -v '^unautrerepertoire/' | |||
grep "Googlebot" > Googlebot.txt | |||
</syntaxhighlight> | |||
== résultats détaillés == | |||
=== affiche les fichiers triés par date précédés du nom du répertoire === | |||
<syntaxhighlight lang="bash" line copy> | |||
ls -lRt | egrep '^\.|*' | |||
</syntaxhighlight> | |||
=== Chercher plusieurs termes avec grep -E (regex étendue) === | |||
<syntaxhighlight lang="bash" line copy> | |||
history | grep -E 'ssh|docker|composer' | |||
</syntaxhighlight> | |||
=== Chercher plusieurs termes présents sur la même ligne avec grep + grep === | |||
<syntaxhighlight lang="bash" line copy> | |||
history | grep 'docker' | grep 'build' | |||
</syntaxhighlight> | |||
== | === Ignorer la casse (majuscules/minuscules) === | ||
<syntaxhighlight lang="bash" line copy> | |||
history | grep -iE 'git|composer' | |||
</syntaxhighlight> | |||
[[category:Linux]] | |||
Dernière version du 3 juin 2025 à 08:41
classique
grep -Rl "{{skin url" * ou grep -Rl "{{skin url" /rep
exclure un repertoire
grep -Rl "quetchose" * | grep -v '^unrepertoire/'
grep -Rl "fwrite" * | grep -v '^unrepertoire/' | grep -v '^unautrerepertoire/'
grep "Googlebot" > Googlebot.txt
résultats détaillés
affiche les fichiers triés par date précédés du nom du répertoire
ls -lRt | egrep '^\.|*'
Chercher plusieurs termes avec grep -E (regex étendue)
history | grep -E 'ssh|docker|composer'
Chercher plusieurs termes présents sur la même ligne avec grep + grep
history | grep 'docker' | grep 'build'
Ignorer la casse (majuscules/minuscules)
history | grep -iE 'git|composer'