LinuxCommandLibrary

etags

Emacs tag file generator

TLDR

Generate TAGS file

$ etags [*.c] [*.h]
copy
Append to existing TAGS
$ etags -a [newfile.c]
copy
Output to specific file
$ etags -o [MYTAGS] [*.c]
copy
Include files from file list
$ etags - < [filelist.txt]
copy
Process specific language
$ etags --language=[c++] [*.cpp]
copy
Recursive directory processing
$ find . -name "*.py" | etags -
copy

SYNOPSIS

etags [options] files...

DESCRIPTION

etags generates tag files for Emacs. Tags enable jumping to function definitions, variable declarations, and other symbols across source files.
The tool parses source files and creates a TAGS file containing symbol locations. Emacs uses this for code navigation with M-. (find-tag) and related commands.

PARAMETERS

-a, --append

Append to existing TAGS file.
-o file
Output to specified file.
-l lang, --language= lang
Force language for following files.
-I, --include= file
Include another tags file.
-r regex, --regex= regex
Tag lines matching regex.
-
Read file names from stdin.
--help
Display help.

SUPPORTED LANGUAGES

C, C++, Java, Python, Perl, Ruby, Lisp, Scheme, Fortran, Pascal, PHP, Lua, Erlang, and many more.

CAVEATS

Different from ctags (Vim tags). TAGS file can grow large. Needs regeneration after code changes. Some languages have limited support.

HISTORY

etags has been part of GNU Emacs since its early versions. It provides the Emacs counterpart to ctags. The tool has evolved to support many programming languages while maintaining compatibility with Emacs tag navigation.

SEE ALSO

ctags(1), emacs(1), cscope(1), global(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community