whereis

명령어의 실행파일위치, 소스위치, man페이지파일위치를 찾아주는 명령어이다.
명령어의 위치만을 찾아주는 which에 비해 명령어와 관련된 파일들을 모두 찾아주므로 보다 포괄적인 명령어위치 탐색명령어라고 이해하면 좋겠다.

그리고 whereis는 특별히 지정된 경로가 없다면 기본적으로 다음의 경로를 바탕으로 탐색한다.

/bin
/usr/bin
/etc
/usr/etc
/sbin
/usr/sbin
/usr/games
/usr/games/bin
/usr/emacs/etc
/usr/lib/emacs/19.22/etc
/usr/lib/emacs/19.23/etc
/usr/lib/emacs/19.24/etc
/usr/lib/emacs/19.25/etc
/usr/lib/emacs/19.26/etc
/usr/lib/emacs/19.27/etc
/usr/lib/emacs/19.28/etc
/usr/lib/emacs/19.29/etc
/usr/lib/emacs/19.30/etc
/usr/TeX/bin
/usr/tex/bin
/usr/interviews/bin/LINUX
/usr/bin/X11
/usr/X11/bin
/usr/X11R5/bin
/usr/X11R6/bin
/usr/X386/bin
/usr/local/bin
/usr/local/etc
/usr/local/sbin
/usr/local/games
/usr/local/games/bin
/usr/local/emacs/etc
/usr/local/TeX/bin
/usr/local/tex/bin
/usr/local/bin/X11
/usr/contrib",
/usr/hosts",
/usr/include",
/usr/g++-include",


사용형식

whereis [ -bmsu ] [ -BMS directory... -f ] filename ...

사용예 #1

whereis의 간단한 사용법으로서 "whereis 명령어" 또는 "whereis 파일이름"으로 탐색할 수 있다.

다음은 find명령어와 관련된 파일을 찾은 예이다.

[root@host3 command]# whereis find
find: /usr/bin/find /usr/share/man/man1/find.1.gz
[root@host3 command]#

다음은 perl명령어와 관련된 파일을 찾은 예이다.

[root@host3 command]# whereis perl
perl: /usr/bin/perl /usr/share/man/man1/perl.1.gz
[root@host3 command]#


사용예 #2

whereis 명령어로 실행파일의 경로만을 확인하고자 할 때에는 -b옵션을 사용한다.
다음은 find 명령어의 실행파일 경로만을 확인하는 예이다.

[root@host3 command]# whereis -b find
find: /usr/bin/find
[root@host3 command]#

-b옵션을 사용하여 실행파일의 경로만을 확인할 때에는 which명령어와 거의 유사하다고 볼 수 있다.


사용예 #3

whereis 명령어로 명령어의 man페이지만을 확인하고자 할때에는 -m옵션을 사용한다.
다음은 find명령어의 man페이지위치를 확인하는 예이다.

[root@host3 command]# whereis -m find
find: /usr/share/man/man1/find.1.gz
[root@host3 command]#


이외에도 잘 사용하지는 않지만 whereis의 옵션에는 다음과 같은 것들이 있다.


-s 명령어의 소스만 찾는다.

-B 명령어의 실행파일을 찾을 경로를 지정하여 탐색한다.

-M 명령어의 매뉴얼 페이지를 찾을 경로를 지정하여 탐색한다.

-S 명령어의 소스파일을 찾을 경로를 지정하여 탐색한다.



크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기

Posted by 홍반장

2004/03/24 11:25 2004/03/24 11:25
Response
No Trackback , No Comment
RSS :
http://tcbs17.cafe24.com/tc/rss/response/189

Trackback URL : http://tcbs17.cafe24.com/tc/trackback/189

« Previous : 1 : ... 6051 : 6052 : 6053 : 6054 : 6055 : 6056 : 6057 : 6058 : 6059 : ... 6391 : Next »

블로그 이미지

- 홍반장

Archives

Recent Trackbacks

Calendar

«   2024/05   »
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  
Statistics Graph

Site Stats

Total hits:
186921
Today:
390
Yesterday:
789