Original link http://blog.csdn.net/yaochunnian/article/details/7261006
grep file Error "binary file ... matches" cause: file for binary files resolved: Strings Vers.log. .-Geneva- the| grep-i ' Mezimedia ' or grep-a-i ' Mezimedia ' Vers.log. .-Geneva- theThe grep command is a line filter tool under Linux, its parameters are numerous, the following is a description of the role of each parameter, we hope to help. grep--print lines matching a pattern (lists the line that conforms to the style) syntax: grep [options] pattern [FILE ...] grep is used to correspond to a portion of the file in the text, or when no file is specified, the The standard input to the comparison. In a preset scenario, grep lists the line that matches the style. In addition, there are two programs that are grep-type, egrep and Fgrep. Where Egrep is the same as grep-E, Fgrep is equivalent to grep-F. Parameters2. -A or--text grep is originally a search text file, if the binary file as the target of the search, it will display the following message: Binary file binary file name matches and then end. If you add-A parameter can be used as a text file search for binary files, which is equivalent to--binary-files=text This parameter. Ex: (Search for panda style from binary archive mv) (Error!!!) $ grep panda mv Binary file MV matches (this means there is a match for this file, see--binary-files=TYPE) $ (correct!!!) $ grep-a panda mv6. --binary-files=Type This parameter type is preset to binary (binary), and if it is searched in the normal way, there are only 2 results:1. If there is a match: Display binary file binary file name matches2If there is no place to match: nothing is shown. If type is without-match, encountering this parameter, grep will assume that the binary file does not contain any search styles, and-The I parameter is the same. If Tpye is text, grep treats this binary file as a text file, with-The a parameter is the same. Warning:--binary-files=text If the output is a terminal, it may produce some unnecessary output. -. -I grep will force that this binary file does not contain any search style, with--binary-files=without-The match parameter is the same. Ex: $ grep-I Panda mv -. -L,--files-without-match does not display the usual output results, but instead shows the names of the files that are not compliant. +. -L,--files-with-matches does not display the usual output results, only the names of the files that are compliant are displayed. Shell script tends to migrate traditional grep to avoid-Q and-s parameter, and limits the output to/dev/NULL. POSIX: Defining Unix and Unix-the functions that the like system needs to provide. -. -V,--Version shows grep's revision number to the standard error. When you return the bugs about grep, the grep version number must be included. -. -V,--invert-match displays all except the search style line.
"Turn" grep file Error "Binary files ... matches"