epubgrep/man/epubgrep.1.adoc

2.8 KiB

epubgrep(1) Manual Page

NAME

epubgrep - Search tool for EPUB ebooks.

SYNOPSIS

epubgrep [OPTION]… PATTERN [FILE]…

DESCRIPTION

epubgrep searches EPUB files in a similar way as grep. It uses the same names for command line switches where possible. However, not all grep switches are implemented and some additional switches are added.

OPTIONS

-h, --help

Display a short help message and exit.

V, --version

Show version, copyright and license.

-G, --basic-regexp

PATTERN is a POSIX basic regular expression. This is the default.

-E, --extended-regexp

PATTERN is a POSIX extended regular expression.

--grep

In combination with --basic-regexp or --extended-regexp, PATTERN is treated as a newline separated list of expressions, a match is found if any of the expressions in the list match.

-P, --perl-regexp

PATTERN is a Perl regular expression.

-i, --ignore-case

Ignore case distinctions in pattern and data.

-e PATTERN, --regexp PATTERN

Use additional PATTERN for matching. Can be used more than once.

USAGE

Configuration

Every command line switch can be used as an option in the configuration file. If the switch has no value (it is a simple on switch), it has to be written as option = 1. Do not use quotation marks around the values, they will be taken literally.

Command line options overwrite configuration file options. Options that can occur more than once are merged.

Example configuration file

This example makes epubgrep always use Perl regular expressions and search for mentions of the words thyme and oregano in every book.

perl-regexp = 1
regexp = \b[Tt]hyme\b
regexp = \b[Oo]regano\b

FILES

Configuration file
  • If XDG_CONFIG_HOME is defined: ${XDG_CONFIG_HOME}/epubgrep.conf

  • If HOME is defined: ${HOME}/.config/epubgrep.conf

  • Otherwise: epubgrep.conf

KNOWN BUGS

EPUB files with non-ASCII file names only work reliably when the system locale uses an encoding which has the necessary characters. Technically EPUBs must use UTF-8 for file names but it is usually recommended to only use ASCII (ASCII is valid UTF-8). If your system locale is not UTF-8, files may be silently skipped. You can work around this by calling epubgrep like this: LC_ALL="C.UTF-8" epubgrep

SEE ALSO

perlre(1)