Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

scruta

scruta (from Latin scruta / scrutari — to search/examine) searches for text patterns in file lines or standard input. It is the core Vesper Linux replacement for GNU grep.

Usage

scruta [-i] [-n] [-v] [-c] [-l] TARGET [FILE...]

Flags

  • -i — ignore case distinctions in patterns and input data.
  • -n — prefix each line of output with its 1-based line number.
  • -v — invert match; select non-matching lines.
  • -c — suppress normal output; print a count of matching lines instead.
  • -l — print only the names of files containing matches.

Examples

Search for a string in a file:

scruta "error" /var/log/syslog

Case-insensitive search with line numbers:

scruta -i -n "todo" main.go

Count matches across multiple files:

scruta -c "failed" auth.log daemon.log

Print only filenames that contain matches:

scruta -l "import" *.go

Filter lines from standard input:

inu config.ini | scruta -v "^#"