Online Linux Terminal Logo
OnlineLinuxTerminal
← Tutoriels•Intermediate

Text Searching & Regex with Grep

Communauté Linux2.4k En ligne

Échangez avec des utilisateurs Linux, apprenez des commandes et téléchargez des PDF.

Lesson Objectives

Step 1: Simple Pattern Match

Run `grep -i "error" /var/log/syslog`.

Step 2: Line Numbering

Run `grep -n -i "accepted" /var/log/auth.log`.

Step 3: Invert Filter

Run `grep -v "^#" /etc/hosts`.

bash — terminal