Misión 29Regex Ninja
+260 XP
Advanced grep Flags (-i, -v, -r, -E)
Iniciar terminal interactiva para esta misión→Sin instalación requerida • Se ejecuta en el navegador
Concepto y descripción general
While basic grep searches for exact strings, production log analysis requires powerful matching flags:
- -i: Case-insensitive search (matches error, Error, or ERROR).
- -v: Invert match (prints lines that do not match the given pattern, perfect for stripping noise).
- -r (or -R): Recursive directory search across all subdirectories and files.
- -E: Extended regular expressions (supports | alternation for multiple patterns, +, and parentheses without escape backslashes).
Instrucciones de la misión
Practice advanced log triage on files inside
1. Run
2. Run
3. Run
4. Run
logs/:1. Run
grep -i "error" logs/app.log to match errors regardless of uppercase/lowercase.2. Run
grep -v "INFO" logs/app.log to filter out routine info lines.3. Run
grep -r "SSH" logs/ to recursively locate SSH activity across all log files in logs/.4. Run
grep -E "(WARNING|ERROR)" logs/app.log to match lines containing either WARNING or ERROR using extended regex.Referencia de sintaxis de comandos
| Command / Syntax | Description |
|---|---|
grep -i "error" logs/app.log | Case-insensitive pattern search |
grep -v "INFO" logs/app.log | Invert search (exclude lines matching pattern) |
grep -r "SSH" logs/ | Recursively search all files in directory |
grep -E "(WARNING|ERROR)" logs/app.log | Search with extended regex alternation |
Objetivos de verificación
- ○Run case-insensitive grep (-i) on logs/app.log
- ○Run inverted grep (-v) to exclude INFO
- ○Run recursive grep (-r) across logs/
- ○Run extended regex grep (-E) with alternation