HFST-GREP(1)

πŸ“¦
version 3.17.1 Β· 2 versions
  • 3.17.1 Β· debian bookworm, debian trixie, nixos 26.05, opensuse-leap 16.0, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 3.17.3 Β· nixpkgs unstable
, in debian bookworm, debian trixie, nixos 26.05, opensuse-leap 16.0, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ 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, -h is also --help up 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 is binary, text, or without-match
  • -a, --text β€” equivalent to --binary-files=text
  • -d, --directories=ACTION β€” how to handle directories; ACTION is read, recurse, or skip
  • -D, --devices=ACTION β€” how to handle devices, FIFOs and sockets; ACTION is read or skip
  • -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 is always, never, or auto
  • -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 Β© 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