Genivia / ugrep

NEW ugrep 6.5: a more powerful, ultra fast, user-friendly, compatible grep. Includes a TUI, Google-like Boolean search with AND/OR/NOT, fuzzy search, hexdumps, searches (nested) archives (zip, 7z, tar, pax, cpio), compressed files (gz, Z, bz2, lzma, xz, lz4, zstd, brotli), pdfs, docs, and more
https://ugrep.com
BSD 3-Clause "New" or "Revised" License
2.56k stars 109 forks source link

option -z is problematic -- what if I want to search a string inside a .gz but not in a file inside a .tgz? #351

Closed schwidom closed 6 months ago

schwidom commented 6 months ago

I found no other option to do that. -z makes too much. It could be split in --zfile and --zarchive to have a clear distinction. And just in case -- what if an an archive contains more zipped files and archives? Then a recursion delimiter woud also be interesting.

Thanks in advance. Frank Schwidom

genivia-inc commented 6 months ago

Not sure what you mean or want. Option -z is limited to one level of archives and compressed files. To search nested archives specify --zmax=2. If you want to search a string in a raw binary .gz file then don't use option -z. If you want to search a .gz but not a .tgz then exclude .tgz from searching with -O^tgz or -g"^*.tgz".

schwidom commented 6 months ago

Ok, I miss --zmax in my version of ugrep.

genivia-inc commented 6 months ago

See also #359 which asks a similar question with my answer to use xargs.