ptx
Produce permuted keyword-in-context index
TLDR
Generate index with line references
SYNOPSIS
ptx [-A] [-r] [-w width] [-o file] [-G] [inputfile_]
DESCRIPTION
ptx produces a permuted index (also known as KWIC - Key Word In Context) from text files. Each significant word appears as an index entry with surrounding context, allowing readers to locate topics by any word.
The output shows each word centered with its surrounding context, useful for creating concordances or keyword indexes for documentation.
PARAMETERS
-A, --auto-reference
Generate automatic index references-r, --references
Use first field as index reference-w, --width _cols_
Output line width in columns-o, --only-file _file_
Read list of words to index-i, --ignore-file _file_
Read list of words to ignore-G, --traditional
SYSV-compatible behavior
CAVEATS
Output format designed for old terminals. May need post-processing for modern use. Word filtering requires separate file. Large files produce extensive output.
HISTORY
ptx is a traditional Unix text processing tool, part of GNU coreutils. Permuted indexes were important for printed documentation before full-text search became common.
