Linux command
etags 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Generate TAGS file
etags [*.c] [*.h]
Append to existing TAGS
etags -a [newfile.c]
Output to specific file
etags -o [MYTAGS] [*.c]
Include files from file list
etags - < [filelist.txt]
Process specific language
etags --language=[c++] [*.cpp]
Recursive directory processing
find . -name "*.py" | etags -
说明
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.
参数
- -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.
FAQ
What is the etags command used for?
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.
How do I run a basic etags example?
Run `etags [*.c] [*.h]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -a, --append do in etags?
Append to existing TAGS file.