Ctags command does not create tags for C header files

I am trying to create a tag file manually for C ( *.cand *.h) sources using the command ctags. Unfortunately, the tag file does not have entries for all files, especially header files.

I use the following command on the command line:

find . -name \*.[ch] -exec ctags {} \; 

Please indicate if any flag or something else is missing.

+3
source share
1 answer

If you run (your version):

find . -name \*.[ch] -exec ctags {} \;

then findexecutes ctagsonce for each file found. The file is tagsoverwritten every time, and only the tags for the last file remain.

find ctags . :

find . -name \*.[ch] -exec ctags {} +

( trojanfoe , ):

ctags $(find . -name \*.[ch])
+1

All Articles