grepdiff - Unix, Linux Command



NAME

grepjar - search files in a jar file for a pattern

SYNOPSIS

grepjar [-bcinsw] -e PATTERN | PATTERN files...

DESCRIPTION

The grepjar program can be used to search files in a jar file for a pattern.

OPTIONS

TagDescription
-b Print byte offset of match.
-c Print number of matches.
-i Compare case-insensitively.
-n Print line number of each match.
-s Suppress error messages.
-w Force PATTERN to match only whole words.
-e PATTERN Use PATTERN as regular expression.
--help Print help, then exit.
-V
--version Print version number, then exit.

EXAMPLES

1. Search for pattern

$ grepjar "Hello World" helloworld.jar
locale/en-US/helloworld.properties:helloMessage=Hello World!

2. Print byte offset if there is match

$ grepjar -b "Hello World" helloworld.jar
locale/en-US/helloworld.properties:0:helloMessage=Hello World!

3. Print the count of matches per file

$ grepjar -c "Hello World" helloworld.jar
content/firefoxOverlay.xul:0
content/overlay.js:0
locale/en-US/helloworld.dtd:0
locale/en-US/helloworld.properties:1
skin/overlay.css:0

4. Case insensitive search

$ grepjar -i "HELLO WORLD" helloworld.jar
locale/en-US/helloworld.properties:helloMessage=Hello World!

5. Print line number for each match

$ grepjar -n "Hello World" helloworld.jar
locale/en-US/helloworld.properties:1:helloMessage=Hello World!

6. Search for whole word

$ grepjar -w Hello helloworld.jar
locale/en-US/helloworld.dtd:<!ENTITY helloworld.label "Hello, World!">
locale/en-US/helloworld.properties:helloMessage=Hello World!
locale/en-US/helloworld.properties:helloMessageTitle=Hello
Advertisements