Search Keyword location in multiple files in Linux

Source: Internet
Author: User

Search Keyword location in multiple files in Linux

An error occurred while compiling u-boot at one time. nand_readd.o was not allowed. I should have found nand_read.o. I used find-iname "nand_readd. * "if this file is not found, I think it should be the key. I will find this error. Too many files cannot be found. I checked this command on the Internet:

Grep-r -- include = *. h-o -- include = *. cpp-o -- include = *. c <key_words_to_search> <path_to_search>

Where-R,-r, -- recursive

Read all files under each directory, recursively; this is equivalent to the-d

Recurse option.

Combined with reality:

Grep-r -- include = *. * nand_readd ~ /U-boot/

I found it soon.

Or:

Full-text search

: Vimgrep (use commands in normal mode) full-text search. The function is the same as the grep command, but supports multi-file jump location in vim.

Usage: vimgrep Regular Expression file. Files support wildcards. For example, *. c Represents all. c files. If you want to perform recursive search, you can use **/* to search all files.

: Cl list results

: Cc (use command in normal mode) Current result

: Cn (use commands in normal mode) next result

: Cp (use command in normal mode) previous result

: Cw (use commands in normal mode) to re-open the search result window

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.