loading
loading
Utilities
Fgrep content in files by an input string.
overview
fgrep-by-string runs a fixed-string search across the files you hand it and keeps only the lines that contain your search term. Because it matches the literal string rather than a regular expression, you do not escape special characters and you never trip over an accidental metacharacter.
In a recon pipeline this is the filter step. Large stages produce noisy output: thousands of URLs, host lines, headers, or scan records. Drop fgrep-by-string after them, pass a fixed marker such as a status token, a domain, or a vulnerability tag, and the node narrows the stream to the records that carry that string.
On Trickest, fgrep-by-string is a Utilities node that takes a file or a folder of files plus a search string and writes a file and a folder of matching lines. Use it to trim a large result set to a subset that matters, or to gate later stages so they run only against records that already contain the marker you care about.
source github.com/trickest
use cases
Pass a fixed marker such as a domain or a status token so a large URL or host file collapses to the lines that carry it, before they reach the next stage.
Point the folder input at a directory of files from a fan-out stage and pull every matching line across all of them in a single node, without merging them first.
Keep only records that contain a specific tag, then feed the trimmed set into probing or scanning so those stages spend work only on lines that already qualify.
Search for terms that contain dots, slashes, or brackets directly, since fixed-string matching treats the input as plain text rather than a pattern.
reference
| Name | Type | Flag | Description |
|---|---|---|---|
| file | FILE | · | File whose lines are searched for the fixed string. |
| fgrep-string | STRING | · | Literal string to match against each line. |
| folder-with-files | FOLDER | · | Folder of files to search across in one run. |
Showing key inputs. fgrep-by-string exposes 3 inputs in total.
example
# fgrep-by-string: keep host lines that mention example.com# inputs: file=hosts.txt fgrep-string=example.comfgrep -h -- example.com hosts.txtwww.example.comapi.example.commail.example.comdev.example.comstaging.example.comcdn.example.comvpn.example.comdocs.example.comguidance
Reach for fgrep-by-string when you need a fast literal filter between pipeline stages: trim a large result set to lines that contain a known marker, or gate later work on that marker. It searches a fixed string, so use a regex-based filter when you need patterns rather than an exact term.
Matches lines against a pattern rather than a fixed string. Use it when you need regular expressions instead of an exact term.
Appends only new, unique lines to a file. Built for dedup and change detection, not content filtering.
Diffs two files to surface the change set. A better fit when you want what changed, not what matches.
faq
related
Import, export, and link workflow data with Airtable.
Decode Android APK files into smali sources and resources.
Check a file's values against conditions and exit with a matching code.
Extract all hosted zones from AWS Route53.
Output file lines by batch size, given START_LINE and END_LINE.
Extract a batch range from a file's lines or a folder's files, with parallel processing.
A file of scan results feeds fgrep-by-string, which keeps only the lines that contain the search string and writes the matches as a queryable output.
Facts on this page come from the live Trickest tool library.