Grep unix manual






















Given one or more patterns, grep searches input files for matches to the patterns. When it finds a match in a line, it copies the line to standard output (by default), or produces whatever other sort of output you have requested with options. If TYPE is text, grep processes a binary file as if it were text; this is equivalent to the -a option. When type is binary, grep may treat non-text bytes as line terminators even without the -z option. This means choosing binary versus text can affect whether a pattern matches a file. Grep searches the named input files (or standard input if no files are named, or the file name - is given) for lines containing a match to the given pattern. By default, grep prints the matching lines.


Character Encoding. The LC_CTYPE locale specifies the encoding of characters in patterns and data, that is, whether text is encoded in UTF-8, ASCII, or some other encoding. See Environment Variables. In the ‘ C ’ or ‘ POSIX ’ locale, every character is encoded as a single byte and every byte is a valid character. If the info and grep programs are properly installed at your site, the command info grep should give you access to the complete manual. COLOPHON top This page is part of the GNU grep (regular expression file search tool) project. -u, --unix-byte-offsets Report Unix-style byte offsets. This switch causes grep to report byte offsets as if the file were a Unix-style text file, i.e., with CR characters stripped off. This will produce results identical to running grep on a Unix machine.


In addition, two variant programs egrep and fgrep are available. Egrep is similar (but not identical) to grep -E, and is compatible with the historical Unix. In the simplest terms, grep (global regular expression print) is a small family of commands that search input files for a search string, and print the lines. UNIX Basic commands: grep The grep command allows you to search one file or multiple files for lines that contain a pattern. Exit status is 0 if matches were.

0コメント

  • 1000 / 1000