Flash Notes

Commandes - Colorisation des résultats de "grep"


• Comment colorer les résultats de "grep" ?

Solution

grep --color chaîne fichier

Exemple 1

$ grep '^root:' /etc/passwd
root:x:0:0:root:/root:/bin/bash

Exemple 2

$ grep --color '^root:' /etc/passwd
root:x:0:0:root:/root:/bin/bash