grep -I
people, I'm studying grep, but did not understand the -I parameter...
Man grep says: "Process a binary file as if it did not contain matching data; this is equivalent to the --binary-files=without-match option." what it means? Any file should be processed like this (as if it did not contain matching data) right? What it means to process a file as if it did contain matching data? thanxs |
Moin,
it means, that binary files are not grepped and don't flood your output with matching messages. Sometimes you want to do a grep pattern * to search for a pattern in a directory containing text and binary files. If you are not interested in matching results from binary files, the -I option helps you to ignore such files. You can try this in /usr/bin, which contains a mix of shell scripts and binaries. Do a grep print * with and without this option. You'll see the difference. Jan |
This is the part of the man page that tells the story:
Code:
--binary-files=TYPE |
Moin,
no, THIS is the only important man page part: Quote:
It's not a question of different binary types. Jan |
ok, i think I understood...
I could use -a together with -I ? in case I dont want this "matches"messages in my output, but i do want to "scan" binary files? tanx again |
Moin,
try it! At my experience it will not work - the options are mutually exclusive. You say "I want binary files to be scanned" and next "I don't want to see binary file's output". The -a option handles binaries like text files (search for a newline or so) and would produce an output you normally do not want to see. Find out what you get when using the different options. You will not nearly understand what all the options do, if you don't try it on a "real world" system. Jan |
really... the command
grep -a -I 'umask.*mask' ./testetemp.iso did nothing... mutually exclusive parameters, really... tanx dudes |
All times are GMT -5. The time now is 05:19 AM. |