利用方法: locate [オプション]... [パターン]... mlocate データベースで項目を探します。 -b, --basename バス名のベース名のみに一致 -c, --count 見つかった項目数のみ印刷 -d, --database DBPATH 省略値のデータベース(/var/lib/mlocate/mlocate.db) の代わりに DBPATH を使う -e, --existing 現在存在するファイル用の項目数のみ印刷 -L, --follow ファイルの存在のチェック(省略値)時に後続する シンボリックリンクに従う -h, --help このヘルプを印刷 -i, --ignore-case パターンの照合時に大小文字を区別しない -l, --limit, -n LIMIT 出力 (又は 計数) を LIMIT 項目に限定 -m, --mmap 無視される、後方互換のため -P, --nofollow, -H ファイルの存在チェック時に後続するシンボリックリンク に従わない -0, --null 出力で項目を NUL で区切る -S, --statistics 項目を探さず、個々の使用したデータベースの統計情報 を印刷 -q, --quiet データベース読込みに関するエラーメッセージを報告しない -r, --regexp REGEXP パターンの代わりに基本正規表現 REGEXP で探す --regex パターンは拡張正規表現 -s, --stdio 無視される、後方互換のため -V, --version バージョン情報を印刷 -w, --wholename 全パス名に一致 (省略値) バグを mitr@redhat.com へ報告してください。
Usage: locate [OPTION]... [PATTERN]... Search for entries in a mlocate database. -b, --basename match only the base name of path names -c, --count only print number of found entries -d, --database DBPATH use DBPATH instead of default database (which is /var/lib/mlocate/mlocate.db) -e, --existing only print entries for currently existing files -L, --follow follow trailing symbolic links when checking file existence (default) -h, --help print this help -i, --ignore-case ignore case distinctions when matching patterns -l, --limit, -n LIMIT limit output (or counting) to LIMIT entries -m, --mmap ignored, for backward compatibility -P, --nofollow, -H don't follow trailing symbolic links when checking file existence -0, --null separate entries with NUL on output -S, --statistics don't search for entries, print statistics about each used database -q, --quiet report no error messages about reading databases -r, --regexp REGEXP search for basic regexp REGEXP instead of patterns --regex patterns are extended regexps -s, --stdio ignored, for backward compatibility -V, --version print version information -w, --wholename match whole path name (default) Report bugs to mitr@redhat.com.
LOCATE(1L) LOCATE(1L) 名前 locate - ファイル名データベースからパターンに合うものを表示する 書式 locate [-d path] [--database=path] [--version] [--help] pattern... 説明 こ の マ ニ ュアルページは GNU 版 locate の使い方を説明したものである。 locate は与えられたパターンそれぞれに対して、一つまたは複数のファイル名 デ ータベースを検索し、パターンを含むファイル名を表示する。パターンには シェルで用いるメタキャラクタ (‘*’, ‘?’ 及び ‘[]’) を用いることができ る 。メタキャラクタは ‘/’ や ‘.’ を特別扱いしない。従って ‘foo*bar’ という パターンは ‘foo3/bar’ というファイル名にマッチするし、 ‘*duck*’ とい う パターンは ‘lake/.ducky’ にマッチする。メタキャラクタを含んだパターンは 、シェルによって展開されないように引用符で囲む必要がある。 パターンが — メタキャラクタを含まない — 通常の文字列である場合 に は 、 locate はその文字列を (部分的にでも、またどんな位置にでも) 含むファイル 名をすべて表示する。もしパターンがメタキャラクタを含む場合には、 locate は パターンに正確に合うファイル名のみを表示する。従って、通常メタキャラ クタを含むパターンには、最初と最後に ‘*’ をつけておくと良い。ただしファ イル名の先頭または最後に意識的にマッチさせたい場合はこの限りではない。 フ ァイル名データベースは、最後に更新された時点において、システムに存在 していたファイルのリストからなっている。システム管理者はデフォルトで 用 い るデータベースのファイル名や更新の頻度、またどのディレクトリの情報を データベースに入れるかなどを選択することができる。 updatedb(1L) を見 よ 。 オプション -d path, --database=path デフォルトのファイル名データベースの代わりに、 path にあるものを 探す。 path はデータベースファイル名のリスト (コロン区切り) であ る。検索するデータベースファイルのリストを指定するには、環境変数 LOCATE_PATH を利用することもできる。このオプションと環境変数が両 方とも指定された場合には、オプションの方が優先される。 ファイル名データベースのフォーマットは GNU 版 find 及び locate のバージ ョン 4.0 から変更された。この変更によって、バイトオーダーの異なるマシン の 間でデータベースを共有することが可能になった。この版の locate は、古 い版の GNU locate や Unix 版 locate 及び find 向けに作成されたデータ ベ ースを自動的に認識できる。 --help locate のオプションに対する短い説明を表示して終了する。 --version locate のバージョンを表示して終了する。 環境変数 LOCATE_PATH コロンによって区切られた検索するデータベースのリスト。 関連項目 find(1L), locatedb(5L), updatedb(1L), xargs(1L) Finding Files (on-line in Info, or printed) LOCATE(1L)
locate(1) locate(1)
NAME
locate - find files by name
SYNOPSIS
locate [OPTION]... PATTERN...
DESCRIPTION
locate reads one or more databases prepared by updatedb(8) and writes
file names matching at least one of the PATTERNs to standard output,
one per line.
If --regex is not specified, PATTERNs can contain globbing characters.
If any PATTERN contains no globbing characters, locate behaves as if
the pattern were *PATTERN*.
By default, locate does not check whether files found in database still
exist. locate can never report files created after the most recent
update of the relevant database.
EXIT STATUS
locate exits with status 0 if any match was found or if locate was
invoked with one of the --limit 0, --help, --statistics or --version
options. If no match was found or a fatal error was encountered,
locate exits with status 1.
Errors encountered while reading a database are not fatal, search con-
tinues in other specified databases, if any.
OPTIONS
-b, --basename
Match only the base name against the specified patterns. This
is the opposite of --wholename.
-c, --count
Instead of writing file names on standard output, write the num-
ber of matching entries only.
-d, --database DBPATH
Replace the default database with DBPATH. DBPATH is a :-sepa-
rated list of database file names. If more than one --database
option is specified, the resulting path is a concatenation of
the separate paths.
An empty database file name is replaced by the default database.
A database file name - refers to the standard input. Note that
a database can be read from the standard input only once.
-e, --existing
Print only entries that refer to files existing at the time
locate is run.
-L, --follow
When checking whether files exist (if the --existing option is
specified), follow trailing symbolic links. This causes broken
symbolic links to be omitted from the output.
This is the default behavior. The opposite can be specified
using --nofollow.
-h, --help
Write a summary of the available options to standard output and
exit successfully.
-i, --ignore-case
Ignore case distinctions when matching patterns.
-l, --limit, -n LIMIT
Exit successfully after finding LIMIT entries. If the --count
option is specified, the resulting count is also limited to
LIMIT.
-m, --mmap
Ignored, for compatibility with BSD and GNU locate.
-P, --nofollow, -H
When checking whether files exist (if the --existing option is
specified), do not follow trailing symbolic links. This causes
broken symbolic links to be reported like other files.
This is the opposite of --follow.
-0, --null
Separate the entries on output using the ASCII NUL character
instead of writing each entry on a separate line. This option
is designed for interoperability with the --null option of GNU
xargs(1).
-S, --statistics
Write statistics about each read database to standard output
instead of searching for files and exit successfully.
-q, --quiet
Write no messages about errors encountered while reading and
processing databases.
-r, --regexp REGEXP
Search for a basic regexp REGEXP. No PATTERNs are allowed if
this option is used, but this option can be specified multiple
times.
--regex
Interpret all PATTERNs as extended regexps.
-s, --stdio
Ignored, for compatibility with BSD and GNU locate.
-V, --version
Write information about the version and license of locate on
standard output and exit successfully.
-w, --wholename
Match only the whole path name against the specified patterns.
This is the default behavior. The opposite can be specified
using --basename.
EXAMPLES
To search for a file named exactly NAME (not *NAME*), use
locate -b ’\NAME’
Because \ is a globbing character, this disables the implicit replace-
ment of NAME by *NAME*.
FILES
/var/lib/mlocate/mlocate.db
The database searched by default.
ENVIRONMENT
LOCATE_PATH
Path to additional databases, added after the default database
or the databases specified using the --database option.
NOTES
The order in which the requested databases are processed is unspeci-
fied, which allows locate to reorder the database path for security
reasons.
locate attempts to be compatible to slocate (without the options used
for creating databases) and GNU locate, in that order. This is the
reason for the impractical default --follow option and for the confus-
ing set of --regex and --regexp options.
The short spelling of the -r option is incompatible to GNU locate,
where it corresponds to the --regex option. Use the long option names
to avoid confusion.
The LOCATE_PATH environment variable replaces the default database in
BSD and GNU locate, but it is added to other databases in this imple-
mentation and slocate.
AUTHOR
Miloslav Trmac
Copyright(C) linux-cmd.com All Rights Reserved. Author Takayuki Yukawa