OS Manuals

/usr/bin/etags

An extensible, customizable, free/libre text editor

From emacs 31.1.90-r0 (os), captured 2026-11-09 by running etags --help (exit 0). permalink

Usage: /usr/bin/etags [options] [[regex-option ...] file-name] ...

These are the options accepted by /usr/bin/etags.
You may use unambiguous abbreviations for the long option names.
  A - as file name means read names from stdin (one per line).
Absolute names are stored in the output file as they are.
Relative ones are stored relative to the output file's directory.

-a, --append
        Append tag entries to existing tags file.
--packages-only
        For Ada files, only generate tags for packages.
--declarations
	In C and derived languages, create tags for function declarations,
	and create tags for extern variables unless --no-globals is used.
	In Mercury, tag both declarations starting a line with ':-' and
        first predicates or functions in clauses.
-D, --no-defines
        Don't create tag entries for C #define constants and enum constants.
	This makes the tags file smaller.
-i FILE, --include=FILE
        Include a note in tag file indicating that, when searching for
        a tag, one should also consult the tags file FILE after
        checking the current file.
-l LANG, --language=LANG
        Force the following files to be considered as written in the
	named language up to the next --language=LANG option.
--no-globals
	Do not create tag entries for global variables in some
	languages.  This makes the tags file smaller.
--no-line-directive
        Ignore #line preprocessor directives in C and derived languages.
--no-members
	Do not create tag entries for members of structures
	in some languages.
--fallback-lang
	If a file's language could not be determined, try to parse
	it as Fortran and C/C++.
--no-fallback-lang
	Do not fall back to Fortran and C/C++ if a file's language
	could not be determined.
--empty-file-entries
	Produce file entries for files with no tags.
--no-empty-file-entries
	Do not output file entries for files with no tags.
-Q, --class-qualify
        Qualify tag names with their class name in C++, ObjC, Java, and Perl.
        This produces tag names of the form "class::member" for C++,
        "class(category)" for Objective C, and "class.member" for Java.
        For Objective C, this also produces class methods qualified with
        their arguments, as in "foo:bar:baz:more".
        For Perl, this produces "package::member".
-r REGEXP, --regex=REGEXP or --regex=@regexfile
        Make a tag for each line matching a regular expression pattern
	in the following files.  {LANGUAGE}REGEXP uses REGEXP for LANGUAGE
	files only.  REGEXFILE is a file containing one REGEXP per line.
	REGEXP takes the form /TAGREGEXP/TAGNAME/MODS, where TAGNAME/ is
	optional.  The TAGREGEXP pattern is anchored (as if preceded by ^).
	If TAGNAME/ is present, the tags created are named.
	For example Tcl named tags can be created with:
	  --regex="/proc[ \t]+\([^ \t]+\)/\1/.".
	MODS are optional one-letter modifiers: 'i' means to ignore case,
	'm' means to allow multi-line matches, 's' implies 'm' and
	causes dot to match any character, including newline.
-R, --no-regex
        Don't create tags from regexps for the following files.
-I, --ignore-indentation
        In C and C++ do not assume that a closing brace in the first
        column is the final brace of a function or structure definition.
-o FILE, --output=FILE
        Write the tags to FILE.
--parse-stdin=NAME
        Read from standard input and record tags as belonging to file NAME.
-V, --version
        Print the version of the program.
-h, --help
        Print this help message.
        Followed by one or more '--language' options prints detailed
        help about tag generation for the specified languages.

These are the currently supported languages, along with the
default file names and dot suffixes:
  ada        .ads .adb .ada
  asm        .a .asm .def .inc .ins .s .sa .S .src
  c          .c .h
  c++        .C .c++ .cc .cpp .cxx .H .h++ .hh .hpp .hxx .M .pdb
  c*         .cs .hs
  cobol      .COB .cob
  erlang     .erl .hrl
  forth      .fth .tok
  fortran    .F .f .f90 .for
  go         .go
  html       .htm .html .shtml
  java       .java
  lisp       .cl .clisp .el .l .lisp .LSP .lsp .ml
  lua        .lua .LUA
  makefile   Makefile makefile GNUMakefile Makefile.in Makefile.am
  objc       .lm .m
  mercury    .m
  pascal     .p .pas
  perl       .pl .pm
  php        .php .php3 .php4
  postscript .ps .psw
  proc       .pc
  prolog     .prolog
  python     .py
  ruby       Rakefile Thorfile .rb .ru .rbw
  rust       .rs
  scheme     .oak .rkt .sch .scheme .SCM .scm .SM .sm .ss .t
  tex        .bib .clo .cls .ltx .sty .TeX .tex
  texinfo    .texi .texinfo .txi
  yacc       .y .y++ .ym .yxx .yy
  auto
  none
where 'auto' means use default language for files based on file
name suffix, and 'none' means only do regexp processing on files.
If no language is specified and no matching suffix is found,
the first line of the file is read for a sharp-bang (#!) sequence
followed by the name of an interpreter.  If no such sequence is found,
Fortran is tried first; if no tags are found, C is tried next.
When parsing any C file, a "class" or "template" keyword
switches to C++.
Compressed files are supported using gzip, bzip2, xz, and zstd.

For detailed help on a given language use, for example,
etags --help --lang=ada.

Report bugs to bug-gnu-emacs@gnu.org
Options (27)
OptionDescriptionSource
-a, --appendAppend tag entries to existing tags file.help + man
--packages-onlyFor Ada files, only generate tags for packages.help + man
--declarationsIn C and derived languages, create tags for function declarations, and create tags for extern variables unless --no-globals is used.help + man
-D, --no-definesDo not create tag entries for C preprocessor constant definitions and enum constants.help + man
-i, --include FILEInclude a note in the tag file indicating that, when searching for a tag, one should also consult the tags file file after checking the current file.help + man
-l, --language LANGForce the following files to be considered as written in the named language up to the next --language=LANG option.help + man
--no-globalsDo not create tag entries for global variables in some languages.help + man
--no-line-directiveIgnore #line preprocessor directives in C and derived languages.help + man
--no-membersDo not create tag entries for members of structures in some languages.help + man
--fallback-langIf a file's language cannot be determined, attempt to parse it as Fortran and C/C++.help + man
--no-fallback-langDo not fall back to Fortran and C/C++ for files whose language is could not be determined.help + man
--empty-file-entriesProduce file entries for files with no tags.help + man
--no-empty-file-entriesDo not output file entries for files with no tags.help + man
-Q, --class-qualifyQualify tag names with their class name in C++, ObjC, Java, and Perl.help + man
-R, --no-regexDon't do any more regexp matching on the following files.help + man
-I, --ignore-indentationIn C and C++ do not assume that a closing brace in the first column is the final brace of a function or structure definition.help + man
-o, --output FILEExplicit name of file for tag table;help + man
--parse-stdin NAMEMay be used (only once) in place of a file name on the command line.help + man
-V, --versionPrint the current version of the program (same as the version of the emacs etags is shipped with).help + man
-h, --help, -HPrint this help message.help + man
-B, --backward-searchTag files written in the format expected by vi contain regular expression search instructions; (in the manual page but not in --help)man
--globalsCreate tag entries for global variables in Perl and Makefile. (in the manual page but not in --help)man
--membersCreate tag entries for variables that are members of structure-like constructs in PHP. (in the manual page but not in --help)man
-r, --regex regexpMake tags based on regexp matching for the files following this option, in addition to the tags made with the standard parsing based on language. (in the manual page but not in --help)man
-u, --updateUpdate tag entries for files specified on command line, leaving tag entries for other files in place. (in the manual page but not in --help)man
-v, --vgrindInstead of generating a tag file, write index (in vgrind format) to standard output. (in the manual page but not in --help)man
-x, --cxrefInstead of generating a tag file, write a cross reference (in cxref format) to standard output. (in the manual page but not in --help)man

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.