neulab/tldr huggingface dataset:
2      Always check the directory name.
The directory name is checked by testing whether the current directory name (as determined by pwd(1)) matches the regex given by the configuration file option DEVSCRIPTS_CHECK_DIRNAME_REGEX or by the command line option --check-dirname-regex regex.  Here regex is a Perl regex (see perlre(3perl)), which will be anchored at the beginning and the end.  If regex contains a '/', then it must match the full directory path.  If not, then it must match the full directory name.  If regex contains the string ´PACKAGE', this will be replaced by the source package name, as determined from the changelog.  The default value for the regex is: ´PACKAGE(-.+)?', thus matching directory names such as PACKAGE and PACKAGE-version.
As environment variables can affect the building of a package, often unintentionally, debuild sanitises the environment by removing all environment variables except for TERM, HOME, LOGNAME, GNUPGHOME, PGPPATH, GPG_AGENT_INFO, GPG_TTY, DBUS_SESSION_BUS_ADDRESS, FAKEROOTKEY, DEBEMAIL, DEB_*, the (C, CPP, CXX, LD and F)FLAGS variables and their _APPEND counterparts and the locale variables LANG and LC_*.  TERM is set to `dumb' if it is unset, and PATH is set to "/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11".
If a particular environment variable is required to be passed through untouched to the build process, this may be specified by using a --preserve-envvar envvar (which can also be written as -e envvar option). The environment may be left untouched by using the --preserve-env option. However, even in this case, the PATH will be set to the sane value described above.  The only way to prevent PATH from being reset is to specify a --preserve-envvar PATH option.  But you are warned that using programs from non-standard locations can easily result in the package being broken, as it will not be able to be built on standard systems.
Note that one may add directories to the beginning of the sanitised PATH, using the --prepend-path option. This is useful when one wishes to use tools such as ccache or distcc for building.
It is also possible to avoid having to type something like FOO=bar debuild -e FOO by writing debuild -e FOO=bar or the long form debuild --set-envvar FOO=bar.
debuild needs to be run as superuser to function properly.  There are three fundamentally different ways to do this.  The first, and preferable, method is to use some root-gaining command.  The best one to use is probably fakeroot(1), since it does not involve granting any genuine privileges.  super(1) and sudo(1) are also possibilities.  If no -r (or --rootcmd) option is given (and recall that dpkg-buildpackage also accepts a -r option) and neither of the following methods is used, then -rfakeroot will silently be assumed.
The second method is to use some command such as su(1) to become root, and then to do everything as root.  Note, though, that lintian will abort if it is run as root or setuid root; this can be overcome using the --allow-root option of lintian if you know what you are doing.
The third possible method is to have debuild installed as setuid root. This is not the default method, and will have to be installed as such by the system administrator.  It must also be realised that anyone who can run debuild as root or setuid root has full access to the whole machine. This method is therefore not recommended, but will work.  debuild could be installed with mode 4754, so that only members of the owning group could run it.  A disadvantage of this method would be that other users would then not be able to use the program.  There are many other variants of this option involving multiple copies of debuild, or the use of programs such as sudo or super to grant root privileges to users selectively.  If the sysadmin wishes to do this, she should use the dpkg- statoverride program to change the permissions of /usr/bin/debuild.  This will ensure that these permissions are preserved across upgrades.
debuild supports a number of hooks when running dpkg-buildpackage.  Note that the hooks dpkg-buildpackage to lintian (inclusive) are passed through to dpkg-buildpackage using its corresponding --hook-name option. The available hooks are as follows:
dpkg-buildpackage-hook Run before dpkg-buildpackage begins by calling dpkg- checkbuilddeps.
Hook is run inside the unpacked source.
Corresponds to dpkg's init hook.
clean-hook Run before dpkg-buildpackage runs debian/rules clean to clean the source tree.  (Run even if the tree is not being cleaned because -nc is used.)
Corresponds to dpkg's preclean hook.
dpkg-source-hook Run after cleaning the tree and before running dpkg-source.  (Run even if dpkg-source is not being called because -b, -B, or -A is used.)
Corresponds to dpkg's source hook.
dpkg-build-hook Run after dpkg-source and before calling debian/rules build.  (Run even if this is a source-only build, so debian/rules build is not being called.)
Corresponds to dpkg's build hook.
dpkg-binary-hook Run between debian/rules build and debian/rules binary(-arch). Run only if a binary package is being built.
Corresponds to dpkg's binary hook.
dpkg-genchanges-hook Run after the binary package is built and before calling dpkg- genchanges.
Corresponds to dpkg's changes hook.
final-clean-hook Run after dpkg-genchanges and before the final debian/rules clean. (Run even if we are not cleaning the tree post-build, which is the default.)
Corresponds to dpkg's postclean hook.
lintian-hook Run (once) before calling lintian.  (Run even if we are not calling lintian.)
Hook is run from parent directory of unpacked source.
Corresponds to dpkg's check hook.
signing-hook Run after calling lintian before any signing takes place.  (Run even if we are not signing anything.)
Corresponds to dpkg's sign hook, but is run by debuild.
post-dpkg-buildpackage-hook Run after everything has finished.
Corresponds to dpkg's done hook, but is run by debuild.
A hook command can be specified either in the configuration file as, for example, DEBUILD_SIGNING_HOOK='foo' (note the hyphens change into underscores!) or as a command line option --signing-hook-foo.  The command will have certain percent substitutions made on it: %% will be replaced by a single % sign, %p will be replaced by the package name, %v by the package version number, %s by the source version number, %u by the upstream version number.  Neither %s nor %u will contain an epoch.  %a will be 1 if the immediately following action is to be performed and 0 if not (for example, in the dpkg-source hook, %a will become 1 if dpkg- source is to be run and 0 if not).  Then it will be handed to the shell to deal with, so it can include redirections and stuff.  For example, to only run the dpkg-source hook if dpkg-source is to be run, the hook could be something like: "if [ %a -eq 1 ]; then ...; fi".
Please take care with hooks, as misuse of them can lead to packages which FTBFS (fail to build from source).  They can be useful for taking snapshots of things or the like.
For details, see above.
--no-conf, --noconf Do not read any configuration files.  This can only be used as the first option given on the command-line.
--rootcmd=gain-root-command, -rgain-root-command Command to gain root (or fake root) privileges.
--preserve-env Do not clean the environment, except for PATH.
--preserve-envvar=var, -evar Do not clean the var variable from the environment.
If var ends in an asterisk ("*") then all variables with names that match the portion of var before the asterisk will be preserved.
--set-envvar=var=value, -evar=value Set the environment variable var to value and do not remove it from the environment.
--prepend-path=value Once the normalized PATH has been set, prepend value to it.
--lintian Run lintian after dpkg-buildpackage.  This is the default behaviour, and it overrides any configuration file directive to the contrary.
--no-lintian Do not run lintian after dpkg-buildpackage.
--no-tgz-check Even if we're running dpkg-buildpackage and the version number has a Debian revision, do not check that the .orig.tar.gz file or .orig directory exists before starting the build.
--tgz-check If we're running dpkg-buildpackage and the version number has a Debian revision, check that the .orig.tar.gz file or .orig directory exists before starting the build.  This is the default behaviour.
--username username When signing, use debrsign instead of debsign.  username specifies the credentials to be used.
--foo-hook=hook Set a hook as described above.  If hook is blank, this unsets the hook.
--clear-hooks Clears all hooks.  They may be reinstated by later command line options.
--check-dirname-level N See the above section Directory name checking for an explanation of this option.
--check-dirname-regex regex See the above section Directory name checking for an explanation of this option.
-d     Do not run dpkg-checkbuilddeps to check build dependencies.
-D     Run dpkg-checkbuilddeps to check build dependencies.
The two configuration files /etc/devscripts.conf and ~/.devscripts are sourced by a shell in that order to set configuration variables.  Command line options can be used to override some of these configuration file settings, otherwise the --no-conf option can be used to prevent reading these files.  Environment variable settings are ignored when these configuration files are read.  The currently recognised variables are:
DEBUILD_PRESERVE_ENV If this is set to yes, then it is the same as the --preserve-env command line parameter being used.
DEBUILD_PRESERVE_ENVVARS Which environment variables to preserve.  This should be a comma- separated list of variables.  This corresponds to using possibly multiple --preserve-envvar or -e options.
DEBUILD_SET_ENVVAR_var=value This corresponds to --set-envvar=var=value.
DEBUILD_PREPEND_PATH This corresponds to --prepend-path.
DEBUILD_ROOTCMD Setting this variable to prog is the equivalent of -rprog.
DEBUILD_TGZ_CHECK Setting this variable to no is the same as the --no-tgz-check command line option.
DEBUILD_SIGNING_USERNAME Setting this variable is the same as using the --username command line option.
DEBUILD_DPKG_BUILDPACKAGE_OPTS These are options which should be passed to the invocation of dpkg-buildpackage.  They are given before any command-line options.  Due to issues of shell quoting, if a word containing spaces is required as a single option, extra quotes will be required.  For example, to ensure that your own GPG key is always used, even for sponsored uploads, the configuration file might contain the line:
DEBUILD_DPKG_BUILDPACKAGE_OPTS="-k'Julian Gilbey <jdg@debian.org>' -sa"
which gives precisely two options.  Without the extra single quotes, dpkg-buildpackage would reasonably complain that Gilbey is an unrecognised option (it doesn't start with a - sign).
Also, if this option contains any -r, -d or -D options, these will always be taken account of by debuild.  Note that a -r option in this variable will override the setting in DEBUILD_ROOTCMD.
DEBUILD_FOO_HOOK The hook variable for the foo hook.  See the section on hooks above for more details.  By default, this is empty.
DEBUILD_LINTIAN Should we run lintian?  If this is set to no, then lintian will not be run.
DEBUILD_LINTIAN_OPTS These are options which should be passed to the invocation of lintian.  They are given before any command-line options, and the usage of this variable is as described for the DEBUILD_DPKG_BUILDPACKAGE_OPTS variable.
DEVSCRIPTS_CHECK_DIRNAME_LEVEL, DEVSCRIPTS_CHECK_DIRNAME_REGEX See the above section Directory name checking for an explanation of these variables.  Note that these are package-wide configuration variables, and will therefore affect all devscripts scripts which check their value, as described in their respective manpages and in devscripts.conf(5).
To build your own package, simply run debuild from inside the source tree.  dpkg-buildpackage(1) options may be given on the command line.
The typical command line options to build only the binary package(s) without signing the .changes file (or the non-existent .dsc file):
debuild -i -us -uc -b
Change the -b to -S to build only a source package.
An example using lintian to check the resulting packages and passing options to it:
debuild --lintian-opts -i
Note the order of options here: the debuild options come first, then the dpkg-buildpackage ones, then finally the checker options.  (And lintian is called by default.)  If you find yourself using the same dpkg- buildpackage options repeatedly, consider using the DEBUILD_DPKG_BUILDPACKAGE_OPTS configuration file option as described above.
To build a package for a sponsored upload, given foobar_1.0-1.dsc and the respective source files, run something like the following commands:
dpkg-source -x foobar_1.0-1.dsc cd foobar-1.0 debuild -k0x12345678
where 0x12345678 is replaced by your GPG key ID or other key identifier such as your email address.  Again, you could also use the DEBUILD_DPKG_BUILDPACKAGE_OPTS configuration file option as described above to avoid having to type the -k option each time you do a sponsored upload.
chmod(1), debsign(1), dpkg-buildpackage(1), dpkg-checkbuilddeps(1), fakeroot(1), lintian(1), su(1), sudo(1), super(1), devscripts.conf(5), dpkg-statoverride(8)
The original debuild program was written by Christoph Lameter <clameter@debian.org>.  The current version has been written by Julian Gilbey <jdg@debian.org>.
KIO::Connection(3)          Library Functions Manual          KIO::Connection(3)
KIO::Connection - This class provides a simple means for IPC between two applications via a pipe.
#include <connection.h>
Inherits QObject.
Public Member Functions void init (KSocket *sock) void init (int fd_in, int fd_out) void connect (QObject *receiver=0, const  char *member=0) void close () int fd_from () const int fd_to () const bool inited () const void send (int cmd, const  QByteArray &arr=QByteArray()) bool sendnow (int _cmd, const  QByteArray &data) int read (int *_cmd, QByteArray &) Receive data. void suspend () Don't handle incoming data until resumed. void resume () Resume handling of incoming data. bool suspended () const Returns status of connection.
Protected Slots void dequeue ()
Detailed Description This class provides a simple means for IPC between two applications via a pipe.
It handles a queue of commands to be sent which makes it possible to queue data before an actual connection has been established.
Definition at line 46 of file connection.h.
Member Function Documentation int Connection::read (int * _cmd, QByteArray &) Receive data. Returns: >=0 indicates the received data size upon success -1 indicates error
Definition at line 197 of file connection.cpp.
Referenced by KIO::SlaveBase::mimeType(), and KIO::SlaveBase::waitForAnswer().
void Connection::suspend () Don't handle incoming data until resumed. Definition at line 64 of file connection.cpp.
References QSocketNotifier::setEnabled().
void Connection::resume () Resume handling of incoming data. Definition at line 71 of file connection.cpp.
bool KIO::Connection::suspended () const [inline] Returns status of connection. Definition at line 90 of file connection.h.
Author Generated automatically by Doxygen for kio Library from the source code.
XMAN(1)                      General Commands Manual                     XMAN(1)
xman - Manual page display program for the X Window System
xman [ -options ... ]
Xman is a manual page browser.  The default size of the initial xman window is small so that you can leave it running throughout your entire login session.  In the initial window there are three options: Help will pop up a window with on-line help, Quit will exit, and Manual Page will pop up a window with a manual page browser in it.  Typing Control-S will pop up a window prompting for a specific manual page to display.  You may display more than one manual page browser window at a time from a single execution of xman.
For further information on using xman, please read the on-line help information.  Most of this manual will discuss customization of xman.
Xman supports all standard Toolkit command line arguments (see X(1)). The following additional arguments are supported.
-helpfile filename Specifies a helpfile to use other than the default.
-bothshown Allows both the manual page and manual directory to be on the screen at the same time.
-notopbox Starts without the Top Menu with the three buttons in it.
-geometry WxH+X+Y Sets the size and location of the Top Menu with the three buttons in it.
-pagesize WxH+X+Y Sets the size and location of all the Manual Pages.
Xman allows customization of both the directories to be searched for manual pages, and the name that each directory will map to in the Sections menu.  Xman determines which directories it will search by reading the MANPATH environment variable.  If no MANPATH is found then the directory is /usr/man is searched on POSIX systems.  This environment is expected to be a colon-separated list of directories for xman to search.
setenv MANPATH /mit/kit/man:/usr/man
By default, xman will search each of the following directories (in each of the directories specified in the users MANPATH) for manual pages.  If manual pages exist in that directory then they are added to list of manual pages for the corresponding menu item.  A menu item is only displayed for those sections that actually contain manual pages.
Directory      Section Name ---------      ------------ man1           (1) User Commands man2           (2) System Calls man3           (3) Subroutines man4           (4) Devices man5           (5) File Formats man6           (6) Games man7           (7) Miscellaneous man8           (8) Sys. Administration manl           (l) Local mann           (n) New mano           (o) Old
For instance, a user has three directories in her manual path and each contain a directory called man3.  All these manual pages will appear alphabetically sorted when the user selects the menu item called (3) Subroutines.  If there is no directory called mano in any of the directories in her MANPATH, or there are no manual pages in any of the directories called mano then no menu item will be displayed for the section called (o) Old.
In newer BSD and Linux systems, Xman will search for a file named /etc/man.conf which will contain the list of directories containing manual pages. See man.conf(5) for a complete description of the file format.
By using the mandesc file a user or system manager is able to more closely control which manual pages will appear in each of the sections represented by menu items in the Sections menu.  This functionality is only available on a section by section basis, and individual manual pages may not be handled in this manner.  (Although generous use of symbolic links — see ln(1) — will allow almost any configuration you can imagine.)
The format of the mandesc file is a character followed by a label.  The character determines which of the sections will be added under this label.  For instance suppose that you would like to create an extra menu item that contains all programmer subroutines.  This label should contain all manual pages in both sections two and three.  The mandesc file would look like this:
2Programmer Subroutines 3Programmer Subroutines
This will add a menu item to the Sections menu that would bring up a listing of all manual pages in sections two and three of the Programmers Manual.  Since the label names are exactly the same they will be added to the same section. Note, however, that the original sections still exist.
If you want to completely ignore the default sections in a manual directory then add the line:
no default sections
anywhere in your mandesc file.  This keeps xman from searching the default manual sections In that directory only.  As an example, suppose you want to do the same thing as above, but you don't think that it is useful to have the System Calls or Subroutines sections any longer.  You would need to duplicate the default entries, as well as adding your new one.
no default sections 1(1) User Commands 2Programmer Subroutines 3Programmer Subroutines 4(4) Devices 5(5) File Formats 6(6) Games 7(7) Miscellaneous 8(8) Sys. Administration l(l) Local n(n) New o(o) Old
Xman will read any section that is of the from man<character>, where <character> is an upper or lower case letter (they are treated distinctly) or a numeral (0-9).  Be warned, however, that man(1) and catman(8) will not search directories that are non-standard.
In order to specify resources, it is useful to know the hierarchy of the widgets which compose xman.  In the notation below, indentation indicates hierarchical structure.  The widget class name is given first, followed by the widget instance name.
Xman xman (This widget is never used) TopLevelShell  topBox Form  form Label  topLabel Command  helpButton Command  quitButton Command  manpageButton TransientShell  search DialogWidgetClass  dialog Label  label Text  value Command  manualPage Command  apropos Command  cancel TransientShell  pleaseStandBy Label  label TopLevelShell  manualBrowser Paned  Manpage_Vpane Paned  horizPane MenuButton  options MenuButton  sections Label  manualBrowser Viewport  directory List  directory List  directory . . (one for each section, .  created on the fly) . ScrollByLine  manualPage SimpleMenu  optionMenu SmeBSB  displayDirectory SmeBSB  displayManualPage SmeBSB  help SmeBSB  search SmeBSB  showBothScreens SmeBSB  removeThisManpage SmeBSB  openNewManpage SmeBSB  showVersion SmeBSB  quit SimpleMenu  sectionMenu SmeBSB  <name of section> . . (one for each section) . TransientShell  search DialogWidgetClass  dialog Label  label Text  value Command  manualPage Command  apropos Command  cancel TransientShell  pleaseStandBy Label  label TransientShell  likeToSave Dialog  dialog Label  label Text  value Command  yes Command  no TopLevelShell  help Paned  Manpage_Vpane Paned  horizPane MenuButton  options MenuButton  sections Label  manualBrowser ScrollByLine  manualPage SimpleMenu  optionMenu SmeBSB  displayDirectory SmeBSB  displayManualPage SmeBSB  help SmeBSB  search SmeBSB  showBothScreens SmeBSB  removeThisManpage SmeBSB  openNewManpage SmeBSB  showVersion SmeBSB  quit
xman has the following application-specific resources which allow customizations unique to xman.
manualFontNormal (Class Font) The font to use for normal text in the manual pages.
manualFontBold (Class Font) The font to use for bold text in the manual pages.
manualFontItalic (Class Font) The font to use for italic text in the manual pages.
directoryFontNormal (Class Font) The font to use for the directory text.
bothShown (Class Boolean) Either `true' or `false,' specifies whether or not you want both the directory and the manual page shown at start up.
directoryHeight (Class DirectoryHeight) The height in pixels of the directory, when the directory and the manual page are shown simultaneously.
topCursor (Class Cursor) The cursor to use in the top box.
helpCursor (Class Cursor) The cursor to use in the help window.
manpageCursor (Class Cursor) The cursor to use in the manual page window.
searchEntryCursor (Class Cursor) The cursor to use in the search entry text widget.
pointerColor (Class Foreground) This is the color of all the cursors (pointers) specified above.  The name was chosen to be compatible with xterm.
helpFile  (Class File) Use this rather than the system default helpfile.
topBox (Class Boolean) Either `true' or `false,' determines whether the top box (containing the help, quit and manual page buttons) or a manual page is put on the screen at start-up.  The default is true.
verticalList (Class Boolean) Either `true' or `false,' determines whether the directory listing is vertically or horizontally organized.  The default is horizontal (false).
Xman defines all user interaction through global actions.  This allows the user to modify the translation table of any widget, and bind any event to the new user action.  The list of actions supported by xman are:
GotoPage(page) When used in a manual page display window this will allow the user to move between a directory and manual page display.  The page argument can be either Directory or ManualPage.
Quit()         This action may be used anywhere, and will exit xman.
Search(type, action) Only useful when used in a search popup, this action will cause the search widget to perform the named search type on the string in the search popup's value widget. This action will also pop down the search widget. The type argument can be either Apropos, Manpage or Cancel.  If an action of Open is specified then xman will open a new manual page to display the results of the search, otherwise xman will attempt to display the results in the parent of the search popup.
PopupHelp()    This action may be used anywhere, and will popup the help widget.
PopupSearch()  This action may be used anywhere except in a help window. It will cause the search popup to become active and visible on the screen, allowing the user search for a manual page.
CreateNewManpage() This action may be used anywhere, and will create a new manual page display window.
RemoveThisManpage() This action may be used in any manual page or help display window.  When called it will remove the window, and clean up all resources associated with it.
SaveFormattedPage(action) This action can only be used in the likeToSave popup widget, and tells xman whether to Save or Cancel a save of the manual page that has just been formatted.
ShowVersion()  This action may be called from any manual page or help display window, and will cause the informational display line to show the current version of xman.
<manpath directory>/man<character>
<manpath directory>/cat<character>
<manpath directory>/mandesc
/etc/X11/app-defaults/Xman specifies required resources.
/tmp                     Xman creates temporary files in /tmp for all unformatted man pages and all apropos searches.
X(7), man(1), apropos(1), catman(8), Athena Widget Set
DISPLAY        the default host and display to use.
MANPATH        the search path for manual pages.  Directories are separated by colons (e.g. /usr/man:/mit/kit/man:/foo/bar/man).
XENVIRONMENT   to get the name of a resource file that overrides the global resources stored in the RESOURCE_MANAGER property.
XAPPLRESDIR    A string that will have ``Xman'' appended to it.  This string will be the full path name of a user app-defaults file to be merged into the resource database after the system app-defaults file, and before the resources that are attached to the display. See X(7) for a full statement of rights and permissions.
Chris Peterson, MIT X Consortium from the V10 version written by Barry Shein formerly of Boston University.  Bug fixes and Linux support by Carlos A M dos Santos, for The XFree86 Project.
RG(1)                                                                      RG(1)
rg - recursively search the current directory for lines matching a pattern
rg [OPTIONS] PATTERN [PATH...]
rg [OPTIONS] -e PATTERN... [PATH...]
rg [OPTIONS] -f PATTERNFILE... [PATH...]
rg [OPTIONS] --files [PATH...]
rg [OPTIONS] --type-list
command | rg [OPTIONS] PATTERN
rg [OPTIONS] --help
rg [OPTIONS] --version
ripgrep (rg) recursively searches the current directory for a regex pattern. By default, ripgrep will respect your .gitignore and automatically skip hidden files/directories and binary files.
ripgrep’s default regex engine uses finite automata and guarantees linear time searching. Because of this, features like backreferences and arbitrary look-around are not supported. However, if ripgrep is built with PCRE2, then the --pcre2 flag can be used to enable backreferences and look-around.
ripgrep supports configuration files. Set RIPGREP_CONFIG_PATH to a configuration file. The file can specify one shell argument per line. Lines starting with # are ignored. For more details, see the man page or the README.
ripgrep will automatically detect if stdin exists and search stdin for a regex pattern, e.g. ls | rg foo. In some environments, stdin may exist when it shouldn’t. To turn off stdin detection explicitly specify the directory to search, e.g. rg foo ./.
Tip: to disable all smart filtering and make ripgrep behave a bit more like classical grep, use rg -uuu.
ripgrep uses Rust’s regex engine by default, which documents its syntax: https://docs.rs/regex/*/regex/#syntax
ripgrep uses byte-oriented regexes, which has some additional documentation: https://docs.rs/regex/*/regex/bytes/index.html#syntax
To a first approximation, ripgrep uses Perl-like regexes without look-around or backreferences. This makes them very similar to the "extended" (ERE) regular expressions supported by egrep, but with a few additional features like Unicode character classes.
If you’re using ripgrep with the --pcre2 flag, then please consult https://www.pcre.org or the PCRE2 man pages for documentation on the supported syntax.
PATTERN A regular expression used for searching. To match a pattern beginning with a dash, use the -e/--regexp option.
PATH A file or directory to search. Directories are searched recursively. File paths specified explicitly on the command line override glob and ignore rules.
Note that many options can be disabled via flags. In some cases, those flags are not listed in a first class way below. For example, the --column flag (listed below) enables column numbers in ripgrep’s output, but the --no-column flag (not listed below) disables them. The reverse can also exist. For example, the --no-ignore flag (listed below) disables ripgrep’s gitignore logic, but the --ignore flag (not listed below) enables it. These flags are useful for overriding a ripgrep configuration file on the command line. Each flag’s documentation notes whether an inverted flag exists. In all cases, the flag specified last takes precedence.
-A, --after-context NUM Show NUM lines after each match.
This overrides the --context and --passthru flags.
--auto-hybrid-regex DEPRECATED. Use --engine instead.
When this flag is used, ripgrep will dynamically choose between supported regex engines depending on the features used in a pattern. When ripgrep chooses a regex engine, it applies that choice for every regex provided to ripgrep (e.g., via multiple -e/--regexp or -f/--file flags).
As an example of how this flag might behave, ripgrep will attempt to use its default finite automata based regex engine whenever the pattern can be successfully compiled with that regex engine. If PCRE2 is enabled and if the pattern given could not be compiled with the default regex engine, then PCRE2 will be automatically used for searching. If PCRE2 isn’t available, then this flag has no effect because there is only one regex engine to choose from.
In the future, ripgrep may adjust its heuristics for how it decides which regex engine to use. In general, the heuristics will be limited to a static analysis of the patterns, and not to any specific runtime behavior observed while searching files.
The primary downside of using this flag is that it may not always be obvious which regex engine ripgrep uses, and thus, the match semantics or performance profile of ripgrep may subtly and unexpectedly change. However, in many cases, all regex engines will agree on what constitutes a match and it can be nice to transparently support more advanced regex features like look-around and backreferences without explicitly needing to enable them.
This flag can be disabled with --no-auto-hybrid-regex.
-B, --before-context NUM Show NUM lines before each match.
--binary Enabling this flag will cause ripgrep to search binary files. By default, ripgrep attempts to automatically skip binary files in order to improve the relevance of results and make the search faster.
Binary files are heuristically detected based on whether they contain a NUL byte or not. By default (without this flag set), once a NUL byte is seen, ripgrep will stop searching the file. Usually, NUL bytes occur in the beginning of most binary files. If a NUL byte occurs after a match, then ripgrep will still stop searching the rest of the file, but a warning will be printed.
In contrast, when this flag is provided, ripgrep will continue searching a file even if a NUL byte is found. In particular, if a NUL byte is found then ripgrep will continue searching until either a match is found or the end of the file is reached, whichever comes sooner. If a match is found, then ripgrep will stop and print a warning saying that the search stopped prematurely.
If you want ripgrep to search a file without any special NUL byte handling at all (and potentially print binary data to stdout), then you should use the -a/--text flag.
The --binary flag is a flag for controlling ripgrep’s automatic filtering mechanism. As such, it does not need to be used when searching a file explicitly or when searching stdin. That is, it is only applicable when recursively searching a directory.
Note that when the -u/--unrestricted flag is provided for a third time, then this flag is automatically enabled.
This flag can be disabled with --no-binary. It overrides the -a/--text flag.
--block-buffered When enabled, ripgrep will use block buffering. That is, whenever a matching line is found, it will be written to an in-memory buffer and will not be written to stdout until the buffer reaches a certain size. This is the default when ripgrep’s stdout is redirected to a pipeline or a file. When ripgrep’s stdout is connected to a terminal, line buffering will be used. Forcing block buffering can be useful when dumping a large amount of contents to a terminal.
Forceful block buffering can be disabled with --no-block-buffered. Note that using --no-block-buffered causes ripgrep to revert to its default behavior of automatically detecting the buffering strategy. To force line buffering, use the --line-buffered flag.
-b, --byte-offset Print the 0-based byte offset within the input file before each line of output. If -o (--only-matching) is specified, print the offset of the matching part itself.
If ripgrep does transcoding, then the byte offset is in terms of the the result of transcoding and not the original data. This applies similarly to another transformation on the source, such as decompression or a --pre filter. Note that when the PCRE2 regex engine is used, then UTF-8 transcoding is done by default.
-s, --case-sensitive Search case sensitively.
This overrides the -i/--ignore-case and -S/--smart-case flags.
--color WHEN This flag controls when to use colors. The default setting is auto, which means ripgrep will try to guess when to use colors. For example, if ripgrep is printing to a terminal, then it will use colors, but if it is redirected to a file or a pipe, then it will suppress color output. ripgrep will suppress color output in some other circumstances as well. For example, if the TERM environment variable is not set or set to dumb, then ripgrep will not use colors.
The possible values for this flag are:
never    Colors will never be used. auto     The default. ripgrep tries to be smart. always   Colors will always be used regardless of where output is sent. ansi     Like 'always', but emits ANSI escapes (even in a Windows console).
When the --vimgrep flag is given to ripgrep, then the default value for the --color flag changes to never.
--colors COLOR_SPEC ... This flag specifies color settings for use in the output. This flag may be provided multiple times. Settings are applied iteratively. Colors are limited to one of eight choices: red, blue, green, cyan, magenta, yellow, white and black. Styles are limited to nobold, bold, nointense, intense, nounderline or underline.
The format of the flag is {type}:{attribute}:{value}. {type} should be one of path, line, column or match. {attribute} can be fg, bg or style. {value} is either a color (for fg and bg) or a text style. A special format, {type}:none, will clear all color settings for {type}.
For example, the following command will change the match color to magenta and the background color for line numbers to yellow:
rg --colors 'match:fg:magenta' --colors 'line:bg:yellow' foo.
Extended colors can be used for {value} when the terminal supports ANSI color sequences. These are specified as either x (256-color) or x,x,x (24-bit truecolor) where x is a number between 0 and 255 inclusive. x may be given as a normal decimal number or a hexadecimal number, which is prefixed by 0x.
For example, the following command will change the match background color to that represented by the rgb value (0,128,255):
rg --colors 'match:bg:0,128,255'
rg --colors 'match:bg:0x0,0x80,0xFF'
Note that the the intense and nointense style flags will have no effect when used alongside these extended color codes.
--column Show column numbers (1-based). This only shows the column numbers for the first match on each line. This does not try to account for Unicode. One byte is equal to one column. This implies --line-number.
This flag can be disabled with --no-column.
-C, --context NUM Show NUM lines before and after each match. This is equivalent to providing both the -B/--before-context and -A/--after-context flags with the same value.
This overrides both the -B/--before-context and -A/--after-context flags, in addition to the --passthru flag.
--context-separator SEPARATOR The string used to separate non-contiguous context lines in the output. This is only used when one of the context flags is used (-A, -B or -C). Escape sequences like \x7F or \t may be used. The default value is --.
When the context separator is set to an empty string, then a line break is still inserted. To completely disable context separators, use the --no-context-separator flag.
-c, --count This flag suppresses normal output and shows the number of lines that match the given patterns for each file searched. Each file containing a match has its path and count printed on each line. Note that this reports the number of lines that match and not the total number of matches, unless -U/--multiline is enabled. In multiline mode, --count is equivalent to --count-matches.
If only one file is given to ripgrep, then only the count is printed if there is a match. The --with-filename flag can be used to force printing the file path in this case. If you need a count to be printed regardless of whether there is a match, then use --include-zero.
This overrides the --count-matches flag. Note that when --count is combined with --only-matching, then ripgrep behaves as if --count-matches was given.
--count-matches This flag suppresses normal output and shows the number of individual matches of the given patterns for each file searched. Each file containing matches has its path and match count printed on each line. Note that this reports the total number of individual matches and not the number of lines that match.
If only one file is given to ripgrep, then only the count is printed if there is a match. The --with-filename flag can be used to force printing the file path in this case.
This overrides the --count flag. Note that when --count is combined with --only-matching, then ripgrep behaves as if --count-matches was given.
--crlf When enabled, ripgrep will treat CRLF (\r\n) as a line terminator instead of just \n.
Principally, this permits $ in regex patterns to match just before CRLF instead of just before LF. The underlying regex engine may not support this natively, so ripgrep will translate all instances of $ to (?:\r??$). This may produce slightly different than desired match offsets. It is intended as a work-around until the regex engine supports this natively.
CRLF support can be disabled with --no-crlf.
--debug Show debug messages. Please use this when filing a bug report.
The --debug flag is generally useful for figuring out why ripgrep skipped searching a particular file. The debug messages should mention all files skipped and why they were skipped.
To get even more debug output, use the --trace flag, which implies --debug along with additional trace data. With --trace, the output could be quite large and is generally more useful for development.
--dfa-size-limit NUM+SUFFIX? The upper size limit of the regex DFA. The default limit is 10M. This should only be changed on very large regex inputs where the (slower) fallback regex engine may otherwise be used if the limit is reached.
The argument accepts the same size suffixes as allowed in with the --max-filesize flag.
-E, --encoding ENCODING Specify the text encoding that ripgrep will use on all files searched. The default value is auto, which will cause ripgrep to do a best effort automatic detection of encoding on a per-file basis. Automatic detection in this case only applies to files that begin with a UTF-8 or UTF-16 byte-order mark (BOM). No other automatic detection is performed. One can also specify none which will then completely disable BOM sniffing and always result in searching the raw bytes, including a BOM if it’s present, regardless of its encoding.
Other supported values can be found in the list of labels here: https://encoding.spec.whatwg.org/#concept-encoding-get
For more details on encoding and how ripgrep deals with it, see GUIDE.md.
This flag can be disabled with --no-encoding.
--engine ENGINE Specify which regular expression engine to use. When you choose a regex engine, it applies that choice for every regex provided to ripgrep (e.g., via multiple -e/--regexp or -f/--file flags).
Accepted values are default, pcre2, or auto.
The default value is default, which is the fastest and should be good for most use cases. The pcre2 engine is generally useful when you want to use features such as look-around or backreferences. auto will dynamically choose between supported regex engines depending on the features used in a pattern on a best effort basis.
Note that the pcre2 engine is an optional ripgrep feature. If PCRE2 wasn’t included in your build of ripgrep, then using this flag will result in ripgrep printing an error message and exiting.
This overrides previous uses of --pcre2 and --auto-hybrid-regex flags.
--field-context-separator SEPARATOR Set the field context separator, which is used to delimit file paths, line numbers, columns and the context itself, when printing contextual lines. The separator may be any number of bytes, including zero. Escape sequences like \x7F or \t may be used. The default value is -.
--field-match-separator SEPARATOR Set the field match separator, which is used to delimit file paths, line numbers, columns and the match itself. The separator may be any number of bytes, including zero. Escape sequences like \x7F or \t may be used. The default value is -.
-f, --file PATTERNFILE ... Search for patterns from the given file, with one pattern per line. When this flag is used multiple times or in combination with the -e/--regexp flag, then all patterns provided are searched. Empty pattern lines will match all input lines, and the newline is not counted as part of the pattern.
A line is printed if and only if it matches at least one of the patterns.
--files Print each file that would be searched without actually performing the search. This is useful to determine whether a particular file is being searched or not.
-l, --files-with-matches Print the paths with at least one match and suppress match contents.
This overrides --files-without-match.
--files-without-match Print the paths that contain zero matches and suppress match contents. This inverts/negates the --files-with-matches flag.
This overrides --files-with-matches.
-F, --fixed-strings Treat the pattern as a literal string instead of a regular expression. When this flag is used, special regular expression meta characters such as .(){}*+ do not need to be escaped.
This flag can be disabled with --no-fixed-strings.
-L, --follow When this flag is enabled, ripgrep will follow symbolic links while traversing directories. This is disabled by default. Note that ripgrep will check for symbolic link loops and report errors if it finds one.
This flag can be disabled with --no-follow.
-g, --glob GLOB ... Include or exclude files and directories for searching that match the given glob. This always overrides any other ignore logic. Multiple glob flags may be used. Globbing rules match .gitignore globs. Precede a glob with a ! to exclude it. If multiple globs match a file or directory, the glob given later in the command line takes precedence.
As an extension, globs support specifying alternatives: -g ab{c,d} is equivalet to -g abc -g abd. Empty alternatives like -g ab{,c} are not currently supported. Note that this syntax extension is also currently enabled in gitignore files, even though this syntax isn’t supported by git itself. ripgrep may disable this syntax extension in gitignore files, but it will always remain available via the -g/--glob flag.
When this flag is set, every file and directory is applied to it to test for a match. So for example, if you only want to search in a particular directory foo, then -g foo is incorrect because foo/bar does not match the glob foo. Instead, you should use -g 'foo/**'.
--glob-case-insensitive Process glob patterns given with the -g/--glob flag case insensitively. This effectively treats --glob as --iglob.
This flag can be disabled with the --no-glob-case-insensitive flag.
--heading This flag prints the file path above clusters of matches from each file instead of printing the file path as a prefix for each matched line. This is the default mode when printing to a terminal.
This overrides the --no-heading flag.
-., --hidden Search hidden files and directories. By default, hidden files and directories are skipped. Note that if a hidden file or a directory is whitelisted in an ignore file, then it will be searched even if this flag isn’t provided.
A file or directory is considered hidden if its base name starts with a dot character (.). On operating systems which support a hidden file attribute, like Windows, files with this attribute are also considered hidden.
This flag can be disabled with --no-hidden.
--iglob GLOB ... Include or exclude files and directories for searching that match the given glob. This always overrides any other ignore logic. Multiple glob flags may be used. Globbing rules match .gitignore globs. Precede a glob with a ! to exclude it. Globs are matched case insensitively.
-i, --ignore-case When this flag is provided, the given patterns will be searched case insensitively. The case insensitivity rules used by ripgrep conform to Unicode’s "simple" case folding rules.
This flag overrides -s/--case-sensitive and -S/--smart-case.
--ignore-file PATH ... Specifies a path to one or more .gitignore format rules files. These patterns are applied after the patterns found in .gitignore and .ignore are applied and are matched relative to the current working directory. Multiple additional ignore files can be specified by using the --ignore-file flag several times. When specifying multiple ignore files, earlier files have lower precedence than later files.
If you are looking for a way to include or exclude files and directories directly on the command line, then used -g instead.
--ignore-file-case-insensitive Process ignore files (.gitignore, .ignore, etc.) case insensitively. Note that this comes with a performance penalty and is most useful on case insensitive file systems (such as Windows).
This flag can be disabled with the --no-ignore-file-case-insensitive flag.
--include-zero When used with --count or --count-matches, print the number of matches for each file even if there were zero matches. This is disabled by default but can be enabled to make ripgrep behave more like grep.
-v, --invert-match Invert matching. Show lines that do not match the given patterns.
--json Enable printing results in a JSON Lines format.
When this flag is provided, ripgrep will emit a sequence of messages, each encoded as a JSON object, where there are five different message types:
begin - A message that indicates a file is being searched and contains at least one match.
end - A message the indicates a file is done being searched. This message also include summary statistics about the search for a particular file.
match - A message that indicates a match was found. This includes the text and offsets of the match.
context - A message that indicates a contextual line was found. This includes the text of the line, along with any match information if the search was inverted.
summary - The final message emitted by ripgrep that contains summary statistics about the search across all files.
Since file paths or the contents of files are not guaranteed to be valid UTF-8 and JSON itself must be representable by a Unicode encoding, ripgrep will emit all data elements as objects with one of two keys: text or bytes. text is a normal JSON string when the data is valid UTF-8 while bytes is the base64 encoded contents of the data.