Skip to content

mmalecki/lrgrep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

lrgrep

Helper script for greping log rotated files. Searches both the current and log rotated files with the same base name.

Installation

npm -g i lrgrep

Usage

$ ls -l
-rw-r--r-- 1 ubuntu ubuntu 493345802 Mar  1 13:52 registry-frontdoor.log
-rw-r--r-- 1 ubuntu ubuntu 161932953 Mar  1 06:25 registry-frontdoor.log.1.gz
-rw-r--r-- 1 ubuntu ubuntu  93318881 Feb 29 06:25 registry-frontdoor.log.2.gz
-rw-r--r-- 1 ubuntu ubuntu  80401821 Feb 28 06:25 registry-frontdoor.log.3.gz
$ lrgrep foobar registry-frontdoor.log
registry-frontdoor.log:foobar
registry-frontdoor.log.2.gz:foobar

Where otherwise you'd have to call grep and zgrep separately like:

$ grep foobar registry-frontdoor.log
foobar
$ zgrep foobar registry-frontdoor.log.*.gz
registry-frontdoor.log.2.gz:foobar

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages