Professional Documents
Culture Documents
txt
NAME
pacman - package manager utility
SYNOPSIS
pacman <operation> [options] [targets]
DESCRIPTION
Pacman is a package management utility that tracks installed packages
on a Linux system. It features dependency support, package groups,
install and uninstall scripts, and the ability to sync your local
machine with a remote repository to automatically upgrade packages.
Pacman packages are a zipped tar format.
Since version 3.0.0, pacman has been the front-end to libalpm(3), the
“Arch Linux Package Management” library. This library allows
alternative front-ends to be written (for instance, a GUI front-end).
OPERATIONS
-D, --database
Operate on the package database. This operation allows you to
modify certain attributes of the installed packages in pacman’s
database. It also allows you to check the databases for internal
consistency. See Database Options below.
-Q, --query
Query the package database. This operation allows you to view
installed packages and their files, as well as meta-information
about individual packages (dependencies, conflicts, install date,
build date, size). This can be run against the local package
database or can be used on individual package files. In the first
case, if no package names are provided in the command line, all
installed packages will be queried. Additionally, various filters
can be applied on the package list. See Query Options below.
-R, --remove
Remove package(s) from the system. Groups can also be specified to
be removed, in which case every package in that group will be
removed. Files belonging to the specified package will be deleted,
and the database will be updated. Most configuration files will be
saved with a .pacsave extension unless the --nosave option is used.
See Remove Options below.
-S, --sync
Synchronize packages. Packages are installed directly from the
remote repositories, including all dependencies required to run the
packages. For example, pacman -S qt will download and install qt
and all the packages it depends on. If a package name exists in
more than one repository, the repository can be explicitly
specified to clarify the package to install: pacman -S testing/qt.
You can also specify version requirements: pacman -S "bash>=3.2".
Quotes are needed, otherwise the shell interprets ">" as
redirection to a file.
file:///home/ghost/Desktop/Notas/teste.txt 1/23
23/09/2018 teste.txt
Packages that provide other packages are also handled. For example,
pacman -S foo will first look for a foo package. If foo is not
found, packages that provide the same functionality as foo will be
searched for. If any package is found, it will be installed. A
selection prompt is provided if multiple packages providing foo are
found.
You can also use pacman -Su to upgrade all packages that are
out-of-date. See Sync Options below. When upgrading, pacman
performs version comparison to determine which packages need
upgrading. This behavior operates as follows:
Alphanumeric:
1.0a < 1.0b < 1.0beta < 1.0p < 1.0pre < 1.0rc < 1.0 < 1.0.a < 1.0.1
Numeric:
1 < 1.0 < 1.1 < 1.1.1 < 1.2 < 2.0 < 3.0.0
-T, --deptest
Check dependencies; this is useful in scripts such as makepkg to
check installed packages. This operation will check each dependency
specified and return a list of dependencies that are not currently
satisfied on the system. This operation accepts no other options.
Example usage: pacman -T qt "bash>=3.2".
-U, --upgrade
Upgrade or add package(s) to the system and install the required
dependencies from sync repositories. Either a URL or file path can
be specified. This is a “remove-then-add” process. See Upgrade
Options below; also see Handling Config Files for an explanation on
how pacman takes care of configuration files.
-F, --files
Query the files database. This operation allows you to look for
packages owning certain files or display files owned by certain
packages. Only packages that are part of your sync databases are
searched. See File Options below.
-V, --version
Display version and exit.
-h, --help
Display syntax for the given operation. If no operation was
supplied, then the general syntax is shown.
OPTIONS
-b, --dbpath <path>
Specify an alternative database location (the default is
/var/lib/pacman). This should not be used unless you know what you
are doing. NOTE: If specified, this is an absolute path, and the
root path is not automatically prepended.
-v, --verbose
Output paths such as as the Root, Conf File, DB Path, Cache Dirs,
etc.
--arch <arch>
Specify an alternate architecture.
--cachedir <dir>
Specify an alternative package cache location (the default is
/var/cache/pacman/pkg). Multiple cache directories can be
specified, and they are tried in the order they are passed to
pacman. NOTE: This is an absolute path, and the root path is not
automatically prepended.
--color <when>
Specify when to enable coloring. Valid options are always, never,
or auto. always forces colors on; never forces colors off; and
auto only automatically enables colors when outputting onto a tty.
--config <file>
Specify an alternate configuration file.
--debug
Display debug messages. When reporting bugs, this option is
recommended to be used.
--gpgdir <dir>
Specify a directory of files used by GnuPG to verify package
signatures (the default is /etc/pacman.d/gnupg). This directory
should contain two files: pubring.gpg and trustdb.gpg. pubring.gpg
holds the public keys of all packagers. trustdb.gpg contains a
so-called trust database, which specifies that the keys are
authentic and trusted. NOTE: This is an absolute path, and the
root path is not automatically prepended.
--hookdir <dir>
Specify a alternative directory containing hook files (the default
is /etc/pacman.d/hooks). Multiple hook directories can be specified
with hooks in later directories taking precedence over hooks in
earlier directories. NOTE: This is an absolute path, and the root
path is not automatically prepended.
--logfile <file>
Specify an alternate log file. This is an absolute path, regardless
of the installation root setting.
--noconfirm
Bypass any and all “Are you sure?” messages. It’s not a good idea
to do this unless you want to run pacman from a script.
--confirm
Cancels the effects of a previous --noconfirm.
--disable-download-timeout
Disable defaults for low speed limit and timeout on downloads. Use
this if you have issues downloading files with proxy and/or
security gateway.
file:///home/ghost/Desktop/Notas/teste.txt 3/23
23/09/2018 teste.txt
--sysroot <dir>
Specify an alternative system root. Pacman will chroot and chdir
into the system root prior to running. This allows mounted guest
systems to be properly operated on. Any other paths given will be
interpreted as relative to the system root. Requires root
privileges.
--assume-installed <package=version>
Add a virtual package "package" with version "version" to the
transaction to satisfy dependencies. This allows to disable
specific dependency checks without affecting all dependency checks.
To disable all dependency checking, see the --nodeps option.
--dbonly
Adds/removes the database entry only, leaving all files in place.
--noprogressbar
Do not show a progress bar when downloading files. This can be
useful for scripts that call pacman and capture the output.
--noscriptlet
If an install scriptlet exists, do not execute it. Do not use this
unless you know what you are doing.
-p, --print
Only print the targets instead of performing the actual operation
(sync, remove or upgrade). Use --print-format to specify how
targets are displayed. The default format string is "%l", which
displays URLs with -S, file names with -U, and pkgname-pkgver with
-R.
--print-format <format>
Specify a printf-like format to control the output of the --print
operation. The possible attributes are: "%n" for pkgname, "%v" for
pkgver, "%l" for location, "%r" for repository, and "%s" for size.
Implies --print.
--asexplicit
Install packages explicitly; in other words, fake their install
reason to be explicitly installed. This is useful if you want to
mark a dependency as explicitly installed so it will not be removed
by the --recursive remove operation.
--ignore <package>
Directs pacman to ignore upgrades of package even if there is one
available. Multiple packages can be specified by separating them
with a comma.
--ignoregroup <group>
file:///home/ghost/Desktop/Notas/teste.txt 4/23
23/09/2018 teste.txt
--needed
Do not reinstall the targets that are already up-to-date.
--overwrite <glob>
Bypass file conflict checks and overwrite conflicting files. If the
package that is about to be installed contains files that are
already installed and match glob, this option will cause all those
files to be overwritten. Using --overwrite will not allow
overwriting a directory with a file or installing packages with
conflicting files and directories. Multiple patterns can be
specified by separating them with a comma. May be specified
multiple times. Patterns can be negated, such that files matching
them will not be overwritten, by prefixing them with an exclamation
mark. Subsequent matches will override previous ones. A leading
literal exclamation mark or backslash needs to be escaped.
-d, --deps
Restrict or filter output to packages installed as dependencies.
This option can be combined with -t for listing real orphans -
packages that were installed as dependencies but are no longer
required by any installed package.
-e, --explicit
Restrict or filter output to explicitly installed packages. This
option can be combined with -t to list explicitly installed
packages that are not required by any other package.
-g, --groups
Display all packages that are members of a named group. If a name
is not specified, list all grouped packages.
-i, --info
Display information on a given package. The -p option can be used
if querying a package file instead of the local database. Passing
two --info or -i flags will also display the list of backup files
and their modification states.
-k, --check
Check that all files owned by the given package(s) are present on
the system. If packages are not specified or filter flags are not
provided, check all installed packages. Specifying this option
twice will perform more detailed file checking (including
permissions, file sizes, and modification times) for packages that
contain the needed mtree file.
-l, --list
List all files owned by a given package. Multiple packages can be
specified on the command line.
-m, --foreign
Restrict or filter output to packages that were not found in the
sync database(s). Typically these are packages that were downloaded
manually and installed with --upgrade.
-n, --native
Restrict or filter output to packages that are found in the sync
database(s). This is the inverse filter of --foreign.
file:///home/ghost/Desktop/Notas/teste.txt 5/23
23/09/2018 teste.txt
-p, --file
Signifies that the package supplied on the command line is a file
and not an entry in the database. The file will be decompressed and
queried. This is useful in combination with --info and --list.
-q, --quiet
Show less information for certain query operations. This is useful
when pacman’s output is processed in a script. Search will only
show package names and not version, group, and description
information; owns will only show package names instead of "file is
owned by pkg" messages; group will only show package names and omit
group names; list will only show files and omit package names;
check will only show pairs of package names and missing files; a
bare query will only show package names rather than names and
versions.
-t, --unrequired
Restrict or filter output to print only packages neither required
nor optionally required by any currently installed package. Specify
this option twice to include packages which are optionally, but not
directly, required by another package.
-u, --upgrades
Restrict or filter output to packages that are out-of-date on the
local system. Only package versions are used to find outdated
packages; replacements are not checked here. This option works best
if the sync database is refreshed using -Sy.
-n, --nosave
Instructs pacman to ignore file backup designations. Normally, when
a file is removed from the system, the database is checked to see
if the file should be renamed with a .pacsave extension.
-s, --recursive
Remove each target specified including all of their dependencies,
provided that (A) they are not required by other packages; and (B)
they were not explicitly installed by the user. This operation is
recursive and analogous to a backwards --sync operation, and it
helps keep a clean system without orphans. If you want to omit
condition (B), pass this option twice.
-u, --unneeded
Removes targets that are not required by any other packages. This
is mostly useful when removing a group without using the -c option,
to avoid breaking any dependencies.
-c, --clean
Remove packages that are no longer installed from the cache as well
as currently unused sync databases to free up disk space. When
pacman downloads packages, it saves them in a cache directory. In
addition, databases are saved for every sync DB you download from
and are not deleted even if they are removed from the configuration
file pacman.conf(5). Use one --clean switch to only remove packages
that are no longer installed; use two to remove all files from the
cache. In both cases, you will have a yes or no option to remove
packages and/or unused downloaded databases.
-g, --groups
Display all the members for each package group specified. If no
group names are provided, all groups will be listed; pass the flag
twice to view all groups and their members.
-i, --info
Display information on a given sync database package. Passing two
--info or -i flags will also display those packages in all
repositories that depend on this package.
-l, --list
List all packages in the specified repositories. Multiple
repositories can be specified on the command line.
-q, --quiet
Show less information for certain sync operations. This is useful
when pacman’s output is processed in a script. Search will only
show package names and not repository, version, group, and
description information; list will only show package names and omit
databases and versions; group will only show package names and omit
group names.
-u, --sysupgrade
Upgrades all packages that are out-of-date. Each
currently-installed package will be examined and upgraded if a
newer package exists. A report of all packages to upgrade will be
presented, and the operation will not proceed without user
confirmation. Dependencies are automatically resolved at this level
and will be installed/upgraded if necessary.
-w, --downloadonly
Retrieve all packages from the server, but do not install/upgrade
anything.
-y, --refresh
Download a fresh copy of the master package database from the
file:///home/ghost/Desktop/Notas/teste.txt 7/23
23/09/2018 teste.txt
--asexplicit <package>
Mark a package as explicitly installed; in other words, set their
install reason to be explicitly installed. This is useful it you
want to keep a package installed even when it was initially
installed as a dependency of another package.
-k, --check
Check the local package database is internally consistent. This
will check all required files are present and that installed
packages have the required dependencies, do not conflict and that
multiple packages do not own the same file. Specifying this option
twice will perform a check on the sync databases to ensure all
specified dependencies are available.
-q, --quiet
Suppress messages on successful completion of database operations.
-l, --list
List the files owned by the queried package.
-s, --search
Search package file names for matching strings.
-x, --regex
Treat arguments to --search as regular expressions.
-o, --owns
Search for packages that own a particular file.
-q, --quiet
Show less information for certain file operations. This is useful
when pacman’s output is processed in a script, however, you may
want to use --machinereadable instead.
--machinereadable
Use a machine readable output format for --list, --search and
--owns. The format is repository\0pkgname\0pkgver\0path\n with \0
being the NULL character and \n a linefeed.
EXAMPLES
pacman -Ss ne.hack
Search for regexp "ne.hack" in package database.
pacman -S gpm
Download and install gpm including dependencies.
pacman -U /home/user/ceofhack-0.6-1-x86_64.pkg.tar.gz
Install ceofhack-0.6-1 package from a local file.
pacman -Syu
Update package list and upgrade all packages afterwards.
CONFIGURATION
See pacman.conf(5) for more details on configuring pacman using the
pacman.conf file.
SEE ALSO
alpm-hooks(5), libalpm(3), makepkg(8), pacman.conf(5)
BUGS
Bugs? You must be kidding; there are no bugs in this software. But if
we happen to be wrong, send us an email with as much detail as possible
to pacman-dev@archlinux.org.
AUTHORS
Current maintainers:
file:///home/ghost/Desktop/Notas/teste.txt 9/23
23/09/2018 teste.txt
NAME
ls - list directory contents
SYNOPSIS
ls [OPTION]... [FILE]...
DESCRIPTION
List information about the FILEs (the current directory by default).
Sort entries alphabetically if none of -cftuvSUX nor --sort is speci-
fied.
-a, --all
do not ignore entries starting with .
-A, --almost-all
do not list implied . and ..
--author
with -l, print the author of each file
-b, --escape
print C-style escapes for nongraphic characters
--block-size=SIZE
with -l, scale sizes by SIZE when printing them; e.g.,
'--block-size=M'; see SIZE format below
-B, --ignore-backups
do not list implied entries ending with ~
-c with -lt: sort by, and show, ctime (time of last modification of
file status information); with -l: show ctime and sort by name;
otherwise: sort by ctime, newest first
--color[=WHEN]
colorize the output; WHEN can be 'always' (default if omitted),
'auto', or 'never'; more info below
file:///home/ghost/Desktop/Notas/teste.txt 10/23
23/09/2018 teste.txt
-d, --directory
list directories themselves, not their contents
-D, --dired
generate output designed for Emacs' dired mode
-F, --classify
append indicator (one of */=>@|) to entries
--file-type
likewise, except do not append '*'
--format=WORD
across -x, commas -m, horizontal -x, long -l, single-column -1,
verbose -l, vertical -C
--full-time
like -l --time-style=full-iso
--group-directories-first
group directories before files;
-G, --no-group
in a long listing, don't print group names
-h, --human-readable
with -l and -s, print sizes like 1K 234M 2G etc.
-H, --dereference-command-line
follow symbolic links listed on the command line
--dereference-command-line-symlink-to-dir
follow each command line symbolic link
--hide=PATTERN
do not list implied entries matching shell PATTERN (overridden
by -a or -A)
--hyperlink[=WHEN]
hyperlink file names; WHEN can be 'always' (default if omitted),
'auto', or 'never'
--indicator-style=WORD
append indicator with style WORD to entry names: none (default),
slash (-p), file-type (--file-type), classify (-F)
-i, --inode
print the index number of each file
-I, --ignore=PATTERN
do not list implied entries matching shell PATTERN
-k, --kibibytes
default to 1024-byte blocks for disk usage; used only with -s
file:///home/ghost/Desktop/Notas/teste.txt 11/23
23/09/2018 teste.txt
-L, --dereference
when showing file information for a symbolic link, show informa-
tion for the file the link references rather than for the link
itself
-n, --numeric-uid-gid
like -l, but list numeric user and group IDs
-N, --literal
print entry names without quoting
-p, --indicator-style=slash
append / indicator to directories
-q, --hide-control-chars
print ? instead of nongraphic characters
--show-control-chars
show nongraphic characters as-is (the default, unless program is
'ls' and output is a terminal)
-Q, --quote-name
enclose entry names in double quotes
--quoting-style=WORD
use quoting style WORD for entry names: literal, locale, shell,
shell-always, shell-escape, shell-escape-always, c, escape
(overrides QUOTING_STYLE environment variable)
-r, --reverse
reverse order while sorting
-R, --recursive
list subdirectories recursively
-s, --size
print the allocated size of each file, in blocks
--sort=WORD
sort by WORD instead of name: none (-U), size (-S), time (-t),
version (-v), extension (-X)
--time=WORD
with -l, show time as WORD instead of default modification time:
atime or access or use (-u); ctime or status (-c); also use
specified time as sort key if --sort=time (newest first)
--time-style=TIME_STYLE
time/date format with -l; see TIME_STYLE below
-T, --tabsize=COLS
assume tab stops at each COLS instead of 8
file:///home/ghost/Desktop/Notas/teste.txt 12/23
23/09/2018 teste.txt
-u with -lt: sort by, and show, access time; with -l: show access
time and sort by name; otherwise: sort by access time, newest
first
-w, --width=COLS
set output width to COLS. 0 means no limit
-Z, --context
print any security context of each file
--version
output version information and exit
Exit status:
0 if OK,
AUTHOR
Written by Richard M. Stallman and David MacKenzie.
REPORTING BUGS
GNU coreutils online help: <https://www.gnu.org/software/coreutils/>
Report ls translation bugs to <https://translationproject.org/team/>
COPYRIGHT
Copyright © 2018 Free Software Foundation, Inc. License GPLv3+: GNU
GPL version 3 or later <https://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.
SEE ALSO
Full documentation at: <https://www.gnu.org/software/coreutils/ls>
or available locally via: info '(coreutils) ls invocation'
file:///home/ghost/Desktop/Notas/teste.txt 13/23
23/09/2018 teste.txt
NAME
grep, egrep, fgrep - print lines matching a pattern
SYNOPSIS
grep [OPTIONS] PATTERN [FILE...]
grep [OPTIONS] -e PATTERN ... [FILE...]
grep [OPTIONS] -f FILE ... [FILE...]
DESCRIPTION
grep searches for PATTERN in each FILE. A FILE of “-” stands for
standard input. If no FILE is given, recursive searches examine the
working directory, and nonrecursive searches read standard input. By
default, grep prints the matching lines.
In addition, the variant programs egrep and fgrep are the same as
grep -E and grep -F, respectively. These variants are deprecated, but
are provided for backward compatibility.
OPTIONS
Generic Program Information
--help Output a usage message and exit.
-V, --version
Output the version number of grep and exit.
Matcher Selection
-E, --extended-regexp
Interpret PATTERN as an extended regular expression (ERE, see
below).
-F, --fixed-strings
Interpret PATTERN as a list of fixed strings (instead of regular
expressions), separated by newlines, any of which is to be
matched.
-G, --basic-regexp
Interpret PATTERN as a basic regular expression (BRE, see
below). This is the default.
-P, --perl-regexp
Interpret the pattern as a Perl-compatible regular expression
(PCRE). This is experimental and grep -P may warn of
unimplemented features.
Matching Control
-e PATTERN, --regexp=PATTERN
Use PATTERN as the pattern. If this option is used multiple
times or is combined with the -f (--file) option, search for all
patterns given. This option can be used to protect a pattern
beginning with “-”.
-f FILE, --file=FILE
Obtain patterns from FILE, one per line. If this option is used
multiple times or is combined with the -e (--regexp) option,
search for all patterns given. The empty file contains zero
patterns, and therefore matches nothing.
-i, --ignore-case
Ignore case distinctions, so that characters that differ only in
case match each other.
file:///home/ghost/Desktop/Notas/teste.txt 14/23
23/09/2018 teste.txt
-v, --invert-match
Invert the sense of matching, to select non-matching lines.
-w, --word-regexp
Select only those lines containing matches that form whole
words. The test is that the matching substring must either be
at the beginning of the line, or preceded by a non-word
constituent character. Similarly, it must be either at the end
of the line or followed by a non-word constituent character.
Word-constituent characters are letters, digits, and the
underscore. This option has no effect if -x is also specified.
-x, --line-regexp
Select only those matches that exactly match the whole line.
For a regular expression pattern, this is like parenthesizing
the pattern and then surrounding it with ^ and $.
--color[=WHEN], --colour[=WHEN]
Surround the matched (non-empty) strings, matching lines,
context lines, file names, line numbers, byte offsets, and
separators (for fields and groups of context lines) with escape
sequences to display them in color on the terminal. The colors
are defined by the environment variable GREP_COLORS. The
deprecated environment variable GREP_COLOR is still supported,
but its setting does not have priority. WHEN is never, always,
or auto.
-L, --files-without-match
Suppress normal output; instead print the name of each input
file from which no output would normally have been printed. The
scanning will stop on the first match.
-l, --files-with-matches
Suppress normal output; instead print the name of each input
file from which output would normally have been printed. The
scanning will stop on the first match.
-m NUM, --max-count=NUM
Stop reading a file after NUM matching lines. If the input is
standard input from a regular file, and NUM matching lines are
output, grep ensures that the standard input is positioned to
just after the last matching line before exiting, regardless of
the presence of trailing context lines. This enables a calling
process to resume a search. When grep stops after NUM matching
lines, it outputs any trailing context lines. When the -c or
--count option is also used, grep does not output a count
greater than NUM. When the -v or --invert-match option is also
used, grep stops after outputting NUM non-matching lines.
-o, --only-matching
Print only the matched (non-empty) parts of a matching line,
with each such part on a separate output line.
-s, --no-messages
Suppress error messages about nonexistent or unreadable files.
-H, --with-filename
Print the file name for each match. This is the default when
there is more than one file to search.
-h, --no-filename
Suppress the prefixing of file names on output. This is the
default when there is only one file (or only standard input) to
search.
--label=LABEL
Display input actually coming from standard input as input
coming from file LABEL. This is especially useful when
implementing tools like zgrep, e.g., gzip -cd foo.gz | grep
--label=foo -H something. See also the -H option.
-n, --line-number
Prefix each line of output with the 1-based line number within
its input file.
-T, --initial-tab
Make sure that the first character of actual line content lies
on a tab stop, so that the alignment of tabs looks normal. This
is useful with options that prefix their output to the actual
content: -H,-n, and -b. In order to improve the probability
that lines from a single file will all start at the same column,
this also causes the line number and byte offset (if present) to
be printed in a minimum size field width.
-u, --unix-byte-offsets
Report Unix-style byte offsets. This switch causes grep to
report byte offsets as if the file were a Unix-style text file,
i.e., with CR characters stripped off. This will produce
results identical to running grep on a Unix machine. This
option has no effect unless -b option is also used; it has no
effect on platforms other than MS-DOS and MS-Windows.
-Z, --null
Output a zero byte (the ASCII NUL character) instead of the
character that normally follows a file name. For example, grep
-lZ outputs a zero byte after each file name instead of the
usual newline. This option makes the output unambiguous, even
in the presence of file names containing unusual characters like
newlines. This option can be used with commands like find
-print0, perl -0, sort -z, and xargs -0 to process arbitrary
file names, even those that contain newline characters.
-B NUM, --before-context=NUM
Print NUM lines of leading context before matching lines.
file:///home/ghost/Desktop/Notas/teste.txt 16/23
23/09/2018 teste.txt
--binary-files=TYPE
If a file's data or metadata indicate that the file contains
binary data, assume that the file is of type TYPE. Non-text
bytes indicate binary data; these are either output bytes that
are improperly encoded for the current locale, or null input
bytes when the -z option is not given.
-D ACTION, --devices=ACTION
If an input file is a device, FIFO or socket, use ACTION to
process it. By default, ACTION is read, which means that
devices are read just as if they were ordinary files. If ACTION
is skip, devices are silently skipped.
-d ACTION, --directories=ACTION
If an input file is a directory, use ACTION to process it. By
default, ACTION is read, i.e., read directories just as if they
were ordinary files. If ACTION is skip, silently skip
directories. If ACTION is recurse, read all files under each
directory, recursively, following symbolic links only if they
are on the command line. This is equivalent to the -r option.
--exclude=GLOB
file:///home/ghost/Desktop/Notas/teste.txt 17/23
23/09/2018 teste.txt
Skip any command-line file with a name suffix that matches the
pattern GLOB, using wildcard matching; a name suffix is either
the whole name, or any suffix starting after a / and before a
+non-/. When searching recursively, skip any subfile whose base
name matches GLOB; the base name is the part after the last /.
A pattern can use *, ?, and [...] as wildcards, and \ to quote
a wildcard or backslash character literally.
--exclude-from=FILE
Skip files whose base name matches any of the file-name globs
read from FILE (using wildcard matching as described under
--exclude).
--exclude-dir=GLOB
Skip any command-line directory with a name suffix that matches
the pattern GLOB. When searching recursively, skip any
subdirectory whose base name matches GLOB. Ignore any redundant
trailing slashes in GLOB.
--include=GLOB
Search only files whose base name matches GLOB (using wildcard
matching as described under --exclude).
-r, --recursive
Read all files under each directory, recursively, following
symbolic links only if they are on the command line. Note that
if no file operand is given, grep searches the working
directory. This is equivalent to the -d recurse option.
-R, --dereference-recursive
Read all files under each directory, recursively. Follow all
symbolic links, unlike -r.
Other Options
--line-buffered
Use line buffering on output. This can cause a performance
penalty.
-U, --binary
Treat the file(s) as binary. By default, under MS-DOS and MS-
Windows, grep guesses whether a file is text or binary as
described for the --binary-files option. If grep decides the
file is a text file, it strips the CR characters from the
original file contents (to make regular expressions with ^ and $
work correctly). Specifying -U overrules this guesswork,
causing all files to be read and passed to the matching
mechanism verbatim; if the file is a text file with CR/LF pairs
at the end of each line, this will cause some regular
expressions to fail. This option has no effect on platforms
other than MS-DOS and MS-Windows.
-z, --null-data
Treat input and output data as sequences of lines, each
terminated by a zero byte (the ASCII NUL character) instead of a
newline. Like the -Z or --null option, this option can be used
with commands like sort -z to process arbitrary file names.
REGULAR EXPRESSIONS
A regular expression is a pattern that describes a set of strings.
Regular expressions are constructed analogously to arithmetic
expressions, by using various operators to combine smaller expressions.
file:///home/ghost/Desktop/Notas/teste.txt 18/23
23/09/2018 teste.txt
The fundamental building blocks are the regular expressions that match
a single character. Most characters, including all letters and digits,
are regular expressions that match themselves. Any meta-character with
special meaning may be quoted by preceding it with a backslash.
Anchoring
The caret ^ and the dollar sign $ are meta-characters that respectively
match the empty string at the beginning and end of a line.
Repetition
A regular expression may be followed by one of several repetition
operators:
? The preceding item is optional and matched at most once.
* The preceding item will be matched zero or more times.
file:///home/ghost/Desktop/Notas/teste.txt 19/23
23/09/2018 teste.txt
Concatenation
Two regular expressions may be concatenated; the resulting regular
expression matches any string formed by concatenating two substrings
that respectively match the concatenated expressions.
Alternation
Two regular expressions may be joined by the infix operator |; the
resulting regular expression matches any string matching either
alternate expression.
Precedence
Repetition takes precedence over concatenation, which in turn takes
precedence over alternation. A whole expression may be enclosed in
parentheses to override these precedence rules and form a
subexpression.
ENVIRONMENT VARIABLES
The behavior of grep is affected by the following environment
variables.
GREP_OPTIONS
This variable specifies default options to be placed in front of
any explicit options. As this causes problems when writing
portable scripts, this feature will be removed in a future
release of grep, and grep warns if it is used. Please use an
alias or script instead.
GREP_COLOR
This variable specifies the color used to highlight matched
(non-empty) text. It is deprecated in favor of GREP_COLORS, but
still supported. The mt, ms, and mc capabilities of GREP_COLORS
have priority over it. It can only specify the color used to
highlight the matching non-empty text in any matching line (a
selected line when the -v command-line option is omitted, or a
context line when -v is specified). The default is 01;31, which
means a bold red foreground text on the terminal's default
background.
file:///home/ghost/Desktop/Notas/teste.txt 20/23
23/09/2018 teste.txt
GREP_COLORS
Specifies the colors and other attributes used to highlight
various parts of the output. Its value is a colon-separated
list of capabilities that defaults to
ms=01;31:mc=01;31:sl=:cx=:fn=35:ln=32:bn=32:se=36 with the rv
and ne boolean capabilities omitted (i.e., false). Supported
capabilities are as follows.
mt=01;31
SGR substring for matching non-empty text in any matching
line (i.e., a selected line when the -v command-line
option is omitted, or a context line when -v is
specified). Setting this is equivalent to setting both
ms= and mc= at once to the same value. The default is a
bold red text foreground over the current line
background.
ms=01;31
SGR substring for matching non-empty text in a selected
line. (This is only used when the -v command-line option
is omitted.) The effect of the sl= (or cx= if rv)
capability remains active when this kicks in. The
default is a bold red text foreground over the current
line background.
mc=01;31
SGR substring for matching non-empty text in a context
line. (This is only used when the -v command-line option
is specified.) The effect of the cx= (or sl= if rv)
capability remains active when this kicks in. The
default is a bold red text foreground over the current
line background.
fn=35 SGR substring for file names prefixing any content line.
The default is a magenta text foreground over the
terminal's default background.
POSIXLY_CORRECT
If set, grep behaves as POSIX requires; otherwise, grep behaves
more like other GNU programs. POSIX requires that options that
follow file names must be treated as file names; by default,
such options are permuted to the front of the operand list and
are treated as options. Also, POSIX requires that unrecognized
options be diagnosed as “illegal”, but since they are not really
against the law the default is to diagnose them as “invalid”.
POSIXLY_CORRECT also disables _N_GNU_nonoption_argv_flags_,
described below.
file:///home/ghost/Desktop/Notas/teste.txt 22/23
23/09/2018 teste.txt
_N_GNU_nonoption_argv_flags_
(Here N is grep's numeric process ID.) If the ith character of
this environment variable's value is 1, do not consider the ith
operand of grep to be an option, even if it appears to be one.
A shell can put this variable in the environment for each
command it runs, specifying which operands are the results of
file name wildcard expansion and therefore should not be treated
as options. This behavior is available only with the GNU C
library, and only when POSIXLY_CORRECT is not set.
EXIT STATUS
Normally the exit status is 0 if a line is selected, 1 if no lines were
selected, and 2 if an error occurred. However, if the -q or --quiet or
--silent is used and a line is selected, the exit status is 0 even if
an error occurred.
COPYRIGHT
Copyright 1998–2000, 2002, 2005–2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is
NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
BUGS
Reporting Bugs
Email bug reports to the bug-reporting address ⟨bug-grep@gnu.org⟩. An
email archive ⟨http://lists.gnu.org/mailman/listinfo/bug-grep⟩ and a
bug tracker ⟨http://debbugs.gnu.org/cgi/pkgreport.cgi?package=grep⟩ are
available.
Known Bugs
Large repetition counts in the {n,m} construct may cause grep to use
lots of memory. In addition, certain other obscure regular expressions
require exponential time and space, and may cause grep to run out of
memory.
SEE ALSO
Regular Manual Pages
awk(1), cmp(1), diff(1), find(1), gzip(1), perl(1), sed(1), sort(1),
xargs(1), zgrep(1), read(2), pcre(3), pcresyntax(3), pcrepattern(3),
terminfo(5), glob(7), regex(7).
Full Documentation
A complete manual ⟨http://www.gnu.org/software/grep/manual/⟩ is
available. If the info and grep programs are properly installed at
your site, the command
info grep
NOTES
This man page is maintained only fitfully; the full documentation is
often more up-to-date.
file:///home/ghost/Desktop/Notas/teste.txt 23/23