HFST-GREP(1)
β¨ NAME β¨
hfst-grep β search for PATTERN in each FILE or standard input. That's the whole vibe, bestie. π
π¦ SYNOPSIS π¦
hfst-grep [OPTIONS...] PATTERN [FILE...]
πΈ DESCRIPTION πΈ
Okay so real talk: this thing goes hunting for PATTERN in every FILE you throw at it, or in standard input if you don't name any files. By default, PATTERN is a Xerox regular expression (XRE for short, iykyk). Like, for example:
hfst-grep 'h e l l o % w o r l d' menu.h menu.c
Obsessed. Anyway, here's everything it can do π
π Common options: π
-h,--helpβ prints the help message, like a lil pep talk-V,--versionβ prints version info, so you know exactly which era of this icon you're on-v,--verboseβ prints verbosely while processing, it will NOT stop yapping-q,--quietβ only prints fatal errors and the output you actually asked for-s,--silentβ alias of--quiet, same energy, different name-9,--format=TYPEβ compiles expressions to TYPE automata
π§ Regexp selection and interpretation: π§
-E,--extended-regexpβ PATTERN is an extended regular expression (ERE)-F,--fixed-stringsβ PATTERN is a set of newline-separated fixed strings-G,--basic-regexpβ PATTERN is a basic regular expression (BRE)-P,--perl-regexpβ PATTERN is a Perl regular expression-X,--xerox-regexpβ PATTERN is a Xerox regular expression-e,--regexp=PATTERNβ use PATTERN for matching-f,--file=FILEβ obtain PATTERN from FILE-I,--ignore-caseβ ignore case distinctions, we're not being picky here-w,--word-regexpβ forces PATTERN to match only whole words-x,--line-regexpβ forces PATTERN to match only whole lines-z,--null-dataβ a data line ends in a 0 byte, not a newline
π Miscellaneous options: π
--no-messagesβ suppress error messages (living in denial, respectfully)--invert-matchβ select non-matching lines, the contrarian arc
π Output control: π
-m,--max-count=NUMβ stop after NUM matches-b,--byte-offsetβ print the byte offset with output lines-n,--line-numberβ print line number with output lines--line-bufferedβ flush output on every line-H,--with-filenameβ print the filename for each match-h,--no-filenameβ suppress the prefixing filename on output (yes,-his also--helpup there, it's giving double life π)--label=LABELβ print LABEL as the filename for standard input-o,--only-matchingβ show only the part of a line matching PATTERN--binary-files=TYPEβ assume that binary files are TYPE; TYPE isbinary,text, orwithout-match-a,--textβ equivalent to--binary-files=text-d,--directories=ACTIONβ how to handle directories; ACTION isread,recurse, orskip-D,--devices=ACTIONβ how to handle devices, FIFOs and sockets; ACTION isreadorskip-R,-r,--recursiveβ equivalent to--directories=recurse--include=FILE_PATTERNβ search only files that match FILE_PATTERN--exclude=FILE_PATTERNβ skip files and directories matching FILE_PATTERN--exclude-from=FILEβ skip files matching any file pattern from FILE--exclude-dir=PATTERNβ directories that match PATTERN will be skipped-L,--files-without-matchβ print only names of *FILE*s containing no match-l,--files-with-matchesβ print only names of *FILE*s containing matches-c,--countβ print only a count of matching lines per FILE-T,--initial-tabβ make tabs line up (if needed)-Z,--nullβ print 0 byte after FILE name
π Context control: π
-B,--before-context=NUMβ print NUM lines of leading context-A,--after-context=NUMβ print NUM lines of trailing context-C,--context=NUMβ print NUM lines of output context--color[=WHEN],--colour[=WHEN]β use markers to highlight the matching strings; WHEN isalways,never, orauto-U,--binaryβ do not strip CR characters at EOL (MSDOS)-u,--unix-byte-offsetsβ report offsets as if CRs were not there (MSDOS)
π REPORTING BUGS π
Found a bug? Not the vibe, but thank you for your service π«Ά Report bugs to <hfst-bugs@helsinki.fi> or directly to the bug tracker at: <https://github.com/hfst/hfst/issues>
The hfst-grep home page lives at: <https://github.com/hfst/hfst/wiki/HfstGrep>
General help using HFST software: <https://github.com/hfst/hfst/wiki>
π COPYRIGHT π
Copyright Β© 2017 University of Helsinki, License GPLv3: GNU GPL version 3 <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. (Say it louder for the people in the back.)
That's the whole page, bestie β HFST manual, August 2018, HFST-GREP(1), sourced from the HFST project. Go forth and grep. Periodt. π
β¨
π¦ where this page comes from
- debian bookworm: hfst 3.16.0-5 Β· GPL-3.0-or-later
- debian trixie: hfst 3.16.2-1+b1 Β· GPL-3.0-or-later
- nixos 26.05: hfst 3.16.2
- opensuse-leap 16.0: hfst 3.16.0-bp160.1.11 Β· Apache-2.0 AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-only AND GPL-3.0-or-later AND GPL-3.0-only
- ubuntu jammy: hfst 3.15.4-2 Β· GPL-3.0-or-later
- ubuntu noble: hfst 3.16.0-5build4 Β· GPL-3.0-or-later
- ubuntu questing: hfst 3.16.2-1
- ubuntu resolute: hfst 3.16.2-1build2 Β· GPL-3.0-or-later
- ubuntu stonking: hfst 3.17.1-6 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms