Exclusive Metin2 game shield on FreeBSD: Automatic siege mode, VIP list, and whitelist from your dashboard. See how it works
Create a server

Guide

How to Install and Use grep

grep finds lines that match a pattern. It is the fast way to hunt errors in logs without opening the whole file.

Steps

  1. On Ubuntu it is usually installed. If missing:

    sudo apt update
    sudo apt install -y grep
  2. Search a string in a log (line numbers, ignore case):

    grep -ni "error" /var/log/nginx/error.log
  3. Search a tree recursively and list only matching files:

    grep -RIl "TODO" /var/www
  4. Pipe journalctl for systemd services:

    sudo journalctl -u nginx --since "1 hour ago" | grep -i fail

Tips

  • Use grep -E (or egrep) for extended regular expressions.
  • On large trees, add --include="*.log" so you skip binaries.

ext step

Logs and root on your own box: Deploy your Cloud VPS.

Related guides