Languages
[Edit]
EN

grep - search text in gzipped file

8 points
Created by:
daniell
490

In this short article, we would like to show how to find any text in gzipped text file (*.gz files) using grep command in Bash.

Quick solution (run the following command):

Where: zgrep calls grep with *.gz files reading support.

 

Orher examples

Edit

1. Searching with case insensitive

Edit

Where:

  • -i or --ignore-case causes text matching with case insensitive ignoring.

2. Searching with regular expressions

Edit

Below command example matches digits in log.gz file.

Where:

  • -E runs searching in regular expression mode,
  • '\d+' should be changed to any regular expression.

 

See also

Edit
  1. Bash - find file name by containing text 
  2. less - browse gzipped logs

Alternative titles

  1. grep - search text in *.gz file
  2. grep - search text in gzip file
  3. grep - find text in gzipped file
  4. grep - find text in *.gz file
  5. grep - find text in gzip file
  6. zgrep - usage simple example
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join