사용 버전 : Linux 우분투(레드햇 계열) 24.04.01 LTS 버전
사용한 시스템 지역/언어 : 대한민국/한글
man whereis 원문
WHEREIS(1) User Commands WHEREIS(1)
NAME
whereis - locate the binary, source, and manual page files for a
command
SYNOPSIS
whereis [options] [-BMS directory... -f] name...
DESCRIPTION
whereis locates the binary, source and manual files for the specified
command names. The supplied names are first stripped of leading
pathname components. Prefixes of s. resulting from use of source code
control are also dealt with. whereis then attempts to locate the
desired program in the standard Linux places, and in the places
specified by $PATH and $MANPATH.
The search restrictions (options -b, -m and -s) are cumulative and
apply to the subsequent name patterns on the command line. Any new
search restriction resets the search mask. For example,
whereis -bm ls tr -m gcc
searches for "ls" and "tr" binaries and man pages, and for "gcc" man
pages only.
The options -B, -M and -S reset search paths for the subsequent name
patterns. For example,
whereis -m ls -M /usr/share/man/man1 -f cal
searches for "ls" man pages in all default paths, but for "cal" in the
/usr/share/man/man1 directory only.
OPTIONS
-b
Search for binaries.
-m
Search for manuals.
-s
Search for sources.
-u
Only show the command names that have unusual entries. A command is
said to be unusual if it does not have just one entry of each
explicitly requested type. Thus 'whereis -m -u *' asks for those
files in the current directory which have no documentation file, or
more than one.
-B list
Limit the places where whereis searches for binaries, by a
whitespace-separated list of directories.
-M list
Limit the places where whereis searches for manuals and
documentation in Info format, by a whitespace-separated list of
directories.
-S list
Limit the places where whereis searches for sources, by a
whitespace-separated list of directories.
-f
Terminates the directory list and signals the start of filenames.
It must be used when any of the -B, -M, or -S options is used.
-l
Output the list of effective lookup paths that whereis is using.
When none of -B, -M, or -S is specified, the option will output the
hard-coded paths that the command was able to find on the system.
-g
Interpret the next names as a glob(7) patterns. whereis always
compares only filenames (aka basename) and never complete path.
Using directory names in the pattern has no effect. Don’t forget
that the shell interprets the pattern when specified on the command
line without quotes. It’s necessary to use quotes for the name, for
example:
whereis -g 'find*'
-h, --help
Display help text and exit.
-V, --version
Print version and exit.
FILE SEARCH PATHS
By default whereis tries to find files from hard-coded paths, which are
defined with glob patterns. The command attempts to use the contents of
$PATH and $MANPATH environment variables as default search path. The
easiest way to know what paths are in use is to add the -l listing
option. Effects of the -B, -M, and -S are displayed with -l.
ENVIRONMENT
WHEREIS_DEBUG=all
enables debug output.
EXAMPLES
To find all files in /usr/bin which are not documented in /usr/man/man1
or have no source in /usr/src:
cd /usr/bin
whereis -u -ms -M /usr/man/man1 -S /usr/src -f *
REPORTING BUGS
For bug reports, use the issue tracker at
https://github.com/util-linux/util-linux/issues.
AVAILABILITY
The whereis command is part of the util-linux package which can be
downloaded from Linux Kernel Archive
<https://www.kernel.org/pub/linux/utils/util-linux/>.
util-linux 2.39.3 2023-11-21 WHEREIS(1)
man whereis 번역기 번역본
WHEREIS(1) 사용자 명령 WHEREIS(1)
이름
whereis - 명령에 대한 바이너리, 소스 및 매뉴얼 페이지 파일을 찾습니다.
요약
whereis [옵션] [-BMS 디렉토리... -f] 이름...
설명
whereis는 지정된 명령 이름에 대한 바이너리, 소스 및 매뉴얼 파일을 찾습니다. 제공된 이름은 먼저 선행
경로 이름 구성 요소를 제거합니다. 소스 코드 제어 사용으로 인한 s. 접두사도 처리합니다. 그런 다음 whereis는 표준 Linux 위치와 $PATH 및 $MANPATH로 지정된 위치에서 원하는 프로그램을 찾으려고 시도합니다.
검색 제한(옵션 -b, -m 및 -s)은 누적되며 명령줄의 후속 이름 패턴에 적용됩니다. 모든 새
검색 제한은 검색 마스크를 재설정합니다. 예를 들어,
whereis -bm ls tr -m gcc
"ls" 및 "tr" 바이너리와 매뉴얼 페이지, "gcc" 매뉴얼 페이지만 검색합니다.
옵션 -B, -M 및 -S는 후속 이름 패턴에 대한 검색 경로를 재설정합니다.
예를 들어,
whereis -m ls -M /usr/share/man/man1 -f cal
모든 기본 경로에서 "ls" 매뉴얼 페이지를 검색하지만 "cal"은
/usr/share/man/man1 디렉터리에서만 검색합니다.
옵션
-b
바이너리를 검색합니다.
-m
매뉴얼을 검색합니다.
-s
소스를 검색합니다.
-u
비정상적인 항목이 있는 명령 이름만 표시합니다. 명령은
명시적으로 요청된 각 유형의 항목이 하나만 없는 경우
비정상적이라고 합니다. 따라서 'whereis -m -u *'는 현재 디렉터리에서 문서 파일이 없는 파일이나
두 개 이상을 요청합니다.
-B list
whereis가 바이너리를 검색하는 위치를 공백으로 구분된 디렉토리 목록으로 제한합니다.
-M list
whereis가 Info 형식의 매뉴얼 및 문서를 검색하는 위치를 공백으로 구분된 디렉토리 목록으로 제한합니다.
-S list
whereis가 소스를 검색하는 위치를 공백으로 구분된 디렉토리 목록으로 제한합니다.
-f
디렉토리 목록을 종료하고 파일 이름의 시작을 알립니다.
-B, -M 또는 -S 옵션을 사용할 때 사용해야 합니다.
-l
whereis가 사용하는 효과적인 조회 경로 목록을 출력합니다.
-B, -M 또는 -S 중 아무것도 지정하지 않으면 이 옵션은 명령이 시스템에서 찾을 수 있었던 하드코딩된 경로를 출력합니다.
-g
다음 이름을 glob(7) 패턴으로 해석합니다. whereis는 항상
파일 이름(일명 basename)만 비교하고 전체 경로를 비교하지 않습니다.
패턴에서 디렉토리 이름을 사용해도 효과가 없습니다. 명령줄에 따옴표 없이 지정하면 셸이 패턴을 해석한다는 것을 잊지 마세요. 예를 들어 이름에 따옴표를 사용해야 합니다.
whereis -g 'find*'
-h, --help
도움말 텍스트를 표시하고 종료합니다.
-V, --version
버전을 인쇄하고 종료합니다.
파일 검색 경로
기본적으로 whereis는 glob 패턴으로 정의된 하드코딩된 경로에서 파일을 찾으려고 합니다. 이 명령은 $PATH 및 $MANPATH 환경 변수의 내용을 기본 검색 경로로 사용하려고 합니다.
사용 중인 경로를 알 수 있는 가장 쉬운 방법은 -l 목록 옵션을 추가하는 것입니다. -B, -M 및 -S의 효과는 -l로 표시됩니다.
환경
WHEREIS_DEBUG=all
은 디버그 출력을 활성화합니다.
예제
/usr/man/man1에 문서화되지 않았거나 /usr/src에 소스가 없는 /usr/bin의 모든 파일을 찾으려면:
cd /usr/bin
whereis -u -ms -M /usr/man/man1 -S /usr/src -f *
버그 보고
버그 보고는
https://github.com/util-linux/util-linux/issues에서 이슈 트래커를 사용하세요.
가용성
whereis 명령은 util-linux 패키지의 일부로,
Linux Kernel Archive에서 다운로드할 수 있습니다.
<https://www.kernel.org/pub/linux/utils/util-linux/>.
util-linux 2.39.3 2023-11-21 WHEREIS(1)
man which 원본
WHICH(1) General Commands Manual WHICH(1)
NAME
which - locate a command
SYNOPSIS
which [-as] filename ...
DESCRIPTION
which returns the pathnames of the files (or links) which would be exe‐
cuted in the current environment, had its arguments been given as com‐
mands 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 canonicalize path names.
OPTIONS
-a print all matching pathnames of each argument
-s silently return 0 if all of the executables were found or 1 oth‐
erwise
EXIT STATUS
0 if all specified commands are found and executable
1 if one or more specified commands is nonexistent or not exe‐
cutable
2 if an invalid option is specified
Debian 29 Jun 2016 WHICH(1)
man which 번역기 번역본
WHICH(1) 일반 명령 설명서 WHICH(1)
이름
which - 명령 찾기
요약
which [-as] 파일 이름 ...
설명
which는 인수가 엄격하게 POSIX 호환 셸에서 명령으로 주어졌다면 현재 환경에서 실행될 파일(또는 링크)의 경로 이름을 반환합니다. 인수의 이름과 일치하는 실행 파일을 PATH에서 검색하여 이를 수행합니다. 경로 이름을 정규화하지 않습니다.
옵션
-a 각 인수의 일치하는 모든 경로 이름을 인쇄합니다.
-s 모든 실행 파일이 발견되면 0을 반환하고 그렇지 않으면 1을 반환합니다.
종료 상태
지정된 모든 명령이 발견되고 실행 가능한 경우 0
지정된 명령 중 하나 이상이 존재하지 않거나 실행할 수 없는 경우 1
잘못된 옵션이 지정된 경우 2
Debian 2016년 6월 29일 WHICH(1)
형태 : whereis [옵션] [파일]
기능 : 지정된 경로에서 명령의 바이너리 파일이나 매뉴얼 파일의 위치를 찾는다.
[옵션]
-b : 바이너리 파일만 검색
-m : 매뉴얼 파일만 검색
-s : 소스 파일만 검색
형태 : which [명령]
기능 : [명령]의 바이너리 파일의 위치를 찾아서 그 경로나 앨리어스를 출력한다.
*바이너리 파일 : 논-텍스트파일을 주로 지칭하며 컴퓨터에서 저장과 처리 목적으로 이진 형식으로 인코딩된 데이터를 포함한다.
*앨리어스 : 별칭이라는 뜻으로 사용자가 명령어를 다른 이름으로 바꿔서 사용할 수 있는 쉘 내부 명령어
which의 경우 whereis -b와 유사한 기능이나
which의 경우 명령을 실행하는 1개의 파일만을 출력해주는 반면
whereis의 경우 명령어와 관련된 모든 파일(실행, 도움말, 소스코드)을 보여준다.
'IT 공부내용 정리 > Linux' 카테고리의 다른 글
| 터미널 명령어 - umask 기본 접근 권한의 설정을 바꿔야 할 때 (0) | 2025.03.06 |
|---|---|
| 터미널 명령어 - chmod 파일의 접근 권한을 설정하고 싶을 때 (1) | 2025.03.06 |
| 터미널 명령어 - find 원하는 파일을 찾고 싶다면 (0) | 2025.03.06 |
| 터미널 명령어 - grep 파일 내용 중에 찾고 싶은 값이 있다면 (1) | 2025.03.06 |
| 터미널 명령어 - touch 파일의 수정시간을 변경하고 싶을 때 (0) | 2025.03.06 |