-1

I have huge directory with makefiles, .c, .h .cpp etc. The final output (binary) is built using make.

To do that I have to find and investigate the source files that use <aio.h> and <execinfo.h> headers. So how do I find the files that use #include <aio.h> and #include <execinfo.h>

4
  • 2
    Grep or a grep-like. Commented Jan 2, 2019 at 22:11
  • 2
    If you need to auto-generate build dependencies you should probably have a look at this. Commented Jan 2, 2019 at 22:22
  • Sounds like you're looking for mkdep Commented Jan 2, 2019 at 23:20
  • Possible duplicate of Identify which file has included some particular header file Commented Jan 4, 2019 at 3:34

2 Answers 2

0

For browsing big code, cscope or ctags is used. Both needs to generate database. For cscope it can be done by command cscope -b-q -k and later cscope-d will give console menu for search options. Find or grep will be slow for browsing of big code.

Sign up to request clarification or add additional context in comments.

Comments

0
find . -name '*.c (or*.h)' -exec grep "thing_to_Search_for" '{}' \; -print 

This command helped me achieve the results I needed.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.