La commande grep sert à rechercher une chaine de caractères.
grep
root@ubuntu:~# grep "^Lundi" /tmp/mylog
root@ubuntu:~# grep -Ev "^(#|$)" /tmp/mylog
root@ubuntu:~# grep -Evc "^(#|$)" /tmp/mylog
root@ubuntu:~# grep -li "warning" /tmp/*.log
root@ubuntu:~# grep -E "^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}" /etc/hosts 127.0.0.1 localhost 127.0.0.1 ip-172-26-5-78
root@ubuntu:~# grep -Eo "^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}" /etc/hosts 127.0.0.1 127.0.0.1