Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

zgrep does stream directly from gzip into grep.

You can see that here: https://git.savannah.gnu.org/cgit/gzip.git/tree/zgrep.in?id=...

It's also mentioned in one of the few comments in zgrep: https://git.savannah.gnu.org/cgit/gzip.git/tree/zgrep.in?id=...

> we use stdin to pass the gzip output to grep

zgrep does create a temporary directory to store the grep search pattern, but only if the pattern is passed via `zgrep -f`, and only if the pattern passed in is not a regular file (i.e. `zgrep -f <(echo "foo") some_file.gz` would create a temporary file with the contents "foo", not with the contents of some_file.gz, and `zgrep -f pattern_file search_file.gz` would not create any temporary file)



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: