Commands similar to grep find strings under Windows [reprint]

Source: Internet
Author: User
Tags printable characters

Https://www.cnblogs.com/zxy1992/p/4372717.html

The findstr command parameters and their meanings are as follows

Look for the string in the file. FINDSTR [/b] [/E] [/L] [/R] [/S] [/i] [/x] [/v] [/n] [/M] [/O] [/p] [/f:file] [/c:string] [/g:file] [/d:dir list] [  /a:color attributes] [/off[line]] strings [[drive:][path]filename[...]  /b starts pairing mode on a line.  /e At the end of a line pairing mode.  /L uses the search string by Word.  /R uses the search string as a generic expression.  /S searches for matching files in the current directory and in all subdirectories.  /I specifies that the search is not case-sensitive.  /x prints rows that match exactly.  /V prints only rows that do not contain matches.  /n Prints the number of lines before each line that matches.  /M If the file contains a match, only its file name is printed.  /o Prints the character offset before each matching line.    /p ignores files that have non-printable characters.  /off[line] does not skip files with an offline property set. /A:ATTR specifies a color attribute with a 16-digit number.  See "Color/?"  /f:file read the file list from the specified file (/on behalf of the console).  /c:string uses the specified string as the literal search string. /g:file gets the search string from the specified file.  (/On behalf of the console).  /d:dir finds a semicolon-delimited list of directories strings the text to find. [Drive:] [path]filename Specifies the file to find. Unless the parameter has a/C prefix, use a space to separate the search string. For example: ' FINDSTR ' Hello there ' x.y ' Look for "hello" or "there" in the file x.y. ' findstr/c: ' Hello there ' x.y ' file x.y look for "Hello there".        Quick reference for general expressions:.        Wildcard: Any character * repetition: previous characters or classes appear 0 or 0 times ^Line position: Line start $ line position: end of line [class] character class: Any character in the character set [^class] complement character class: Any character that is not in the character set [x-y] range: Any character within the specified range/x Es Cape: Literal usage of meta-character x/<xyz Word position: start of Word xyz/> word position: end of Word

Enter commands within a folder

findstr/s/i/m "www.google.com.hk"

Find the configuration file to change, solve the problem.

Commands similar to grep find strings under Windows [reprint]

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.