Skip to content

Commit defa425

Browse files
committed
update readme
1 parent 6f40466 commit defa425

File tree

1 file changed

+23
-37
lines changed

1 file changed

+23
-37
lines changed

README.md

Lines changed: 23 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,24 @@
33

44
## Usage
55
### Searching for a byte sequence in a file
6-
`$ grep_bin test.bin fffe`
6+
`$ grep_bin fffe test.bin`
77

88
### Searching recursively a directory for a byte sequence
9-
`$ grep_bin ~/Downloads FFFE`
9+
`$ grep_bin FFFE ~/Downloads`
1010

1111
### Filtering the filetypes
12-
`$ grep_bin ~/Downloads FFfe0000 -f mp3 `
12+
`$ grep_bin -f mp3 FFfe0000 ~/Downloads`
1313

1414
### Search for an ASCII string inside the binary
15-
`$ grep_bin test.bin '"Hello World"'`
15+
`$ grep_bin '"Hello World"' test.bin`
1616

17-
Search for an ASCII string with quotes included: `$ grep_bin test.bin '"This is a \"quote\""'`
17+
Search for an ASCII string with quotes included: `$ grep_bin '"This is a \"quote\""' test.bin`
1818

1919
### Search a byte sequence in multiple files
20-
`$ grep_bin test1.bin test2.bin fFFe`
20+
`$ grep_bin fFFe test1.bin test2.bin`
2121

2222
### Specify the number of bytes per line in the output
23-
`$ grep_bin README.md "information" -c 32`
23+
`$ grep_bin -c 32 "information" README.md`
2424

2525
Output:
2626
<pre>
@@ -33,43 +33,29 @@ README.md
3333
```
3434
$ grep_bin -h
3535
36+
grep_bin 2.0.0
3637
LaBatata101 <labatata101@linuxmail.org>
3738
Searches recursively a directory or multiple files for a sequence of bytes or ASCII string.
3839
3940
USAGE:
40-
grep_bin [FLAGS] [OPTIONS] <FILE>... <PATTERN>
41-
42-
FLAGS:
43-
-h, --help
44-
Prints help information
45-
46-
-p, --print-only
47-
Prints only the file name that contais the match.
48-
49-
-V, --version
50-
Prints version information
41+
grep_bin [OPTIONS] <PATTERN> <FILE>...
5142
43+
ARGS:
44+
<PATTERN> Ascii strings should be passed inside quotes like so '"This is a string"'
45+
Escaping quotes '"This is a \"quoted string\""'
46+
All of these byte sequence are valid: f9b4ca, F9B4CA and f9B4Ca
47+
<FILE>... The filepath
5248
5349
OPTIONS:
54-
-c <context_bytes_size>
55-
Defines the number of bytes that will be printed in each line. [default: 16]
56-
57-
-f <filetype>...
58-
Filter the search by the file extensions.
59-
Examples of input: jpg, mp3, exe
60-
-s, --skip-bytes <skip_bytes>
61-
Skip n bytes before searching. [default: 0]
62-
63-
64-
ARGS:
65-
<FILE>...
66-
The file path
67-
68-
<PATTERN>
69-
Can be a ascii string or a byte sequence.
70-
Ascii strings should be passed inside quotes like so '"This is a string"'
71-
Escaping quotes '"This is a \"quote\""'
72-
All of these byte sequence are valid: f9b4ca, F9B4CA and f9B4Ca
50+
-c <context_bytes_size> Defines the number of bytes that will be printed in each line.
51+
[default: 16]
52+
-f <filetype> Filter the search by the file extensions.
53+
Examples of input: jpg, mp3, exe
54+
-h, --help Print help information
55+
-o, --print-offset Prints only the offsets of the match.
56+
-p, --print-only Prints only the filename that contais the match.
57+
-s, --skip-bytes <n> Skip n bytes before searching. [default: 0]
58+
-V, --version Print version information
7359
```
7460

7561
# Building Manually

0 commit comments

Comments
 (0)