grepstein.sh is a small Bash script for searching and reading PDF documents from the U.S. Department of Justice (justice.gov) multimedia archive directly in the terminal.
It allows you to search by keyword, browse results page by page, and open PDF files without leaving the command line.
- Keyword search on justice.gov
- Paginated results (navigate with NEXT)
- Read PDF files directly in the terminal
- No browser required
The following tools must be installed on your system:
pdftotextjqhttpie
The script automatically checks for missing dependencies before running.
sudo pacman -S poppler jq httpiesudo apt install poppler-utils jq httpiegit clone https://github.com/sertacartun/grepstein.git
cd grepstein
chmod +x grepstein.sh./grepstein.sh <search_term>Example:
./grepstein.sh epsteinAfter listing the results, the script waits for a command:
OPEN→ Open a selected PDF in the terminalNEXT→ Go to the next pageEXIT→ Exit the program
When opening a file, enter the index number shown in the list.
- PDF files are downloaded temporarily to
/tmpand removed after viewing. - Some justice.gov content requires an age-verification cookie; this script includes it automatically.
- Intended for reading and research purposes only.
MIT