Generate tags files (POSIX)


ctags [-aBeFhilNprstvx] [-Dword] files...

Runs on:

QNX Neutrino, Microsoft Windows


Append to the tags file, instead of overwriting it.
Use ?regexp? instead of /regexp/.
Ignore word. This is handy for parameter macro names.
Include extern tags.
Use /regexp/ (the default).
Add hints to help elvis distinguish between overloaded tags.
Include inline definitions.
("el") Add a ln line number hint (implies -h).
Use line numbers instead of /regexp/.
Write parsing information to stdout (for debugging ctags).
Write a refs file, in addition to tags.
Include static tags.
Include typedefs.
Include variable declarations.
Write a cross-reference table to stdout instead of to the tags file.
The pathnames of the files that are to be scanned for tags.


The ctags utility generates a file called tags from a group of C source files.

Each C source file is scanned for #define statements and function definitions. The name of the macro or function becomes the name of a tag. For each tag, a line is added to the tags file, which contains:

If you don't specify any options, ctags uses -l -i -s -t -v.

The elvis, more, vi, and less, utilities can use entries in the tags file to locate and display a definition.


Generate tags for all the C source and header files in the current directory:

ctags *.[ch]

Contributing author:

Steve Kirkendall; ctags is part of the elvis suite.