Online Linux Terminal Logo
OnlineLinuxTerminal
← 实战教程•Intermediate

Text Searching & Regex with Grep

Linux 社区2.4k 在线

与真实 Linux 用户交流,学习常用命令并免费获取精美速查表 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