linux 查找命令

which

NAME

       which - locate a command
SYNOPSIS
       which [-a] filename ...
DESCRIPTION
       which  returns  the  pathnames  of  the  files  (or links) which would be executed in the current environment, had its arguments been given as commands in a

       strictly POSIX-conformant shell.  It does this by searching the PATH for executable files matching the names of the arguments. It does not  follow  symbolic links.

whereis

NAME
       whereis - locate the binary, source, and manual page files for a command
SYNOPSIS
       whereis [-bmsu] [-BMS directory...  -f] filename...
DESCRIPTION
       whereis  locates source/binary and manuals sections for specified files.  The supplied names are first stripped of leading pathname components and any (sin‐
       gle) trailing extension of the form .ext, for example, .c.  Prefixes of s.  resulting from use of source code control are also  dealt  with.   whereis  then
       attempts to locate the desired program in a list of standard Linux places.
OPTIONS
       -b     Search only for binaries.
       -m     Search only for manual sections.
       -s     Search only for sources.
       -u     Search  for  unusual entries.  A file is said to be unusual if it does not have one entry of each requested type.  Thus `whereis  -m  -u  *' asks for
              those files in the current directory which have no documentation.
       -B     Change or otherwise limit the places where whereis searches for binaries.
       -M     Change or otherwise limit the places where whereis searches for manual sections.
       -S     Change or otherwise limit the places where whereis searches for sources.
       -f     Terminate the last directory list and signals the start of file names, and must be used when any of the -B, -M, or -S options are used.
EXAMPLE
       Find all files in /usr/bin which are not documented in /usr/man/man1 with source in /usr/src:
              example% cd /usr/bin
              example% whereis -u -M /usr/man/man1 -S /usr/src -f 16"4

locate

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.

find

NAME
       find - search for files in a directory hierarchy
SYNOPSIS
       find [-H] [-L] [-P] [-D debugopts] [-Olevel] [path...] [expression]
DESCRIPTION
       This  manual page documents the GNU version of find.  GNU find searches the directory tree rooted at each given file name by evaluating the given expression
       from left to right, according to the rules of precedence (see section OPERATORS), until the outcome is known (the left hand side is  false  for  and  opera‐
       tions, true for or), at which point find moves on to the next file name.
       If  you  are  using  find  in  an  environment where security is important (for example if you are using it to search directories that are writable by other
       users), you should read the "Security Considerations" chapter of the findutils documentation, which is called Finding Files and comes with findutils.   That
       document also includes a lot more detail and discussion than this manual page, so you may find it a more useful source of information.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值