which (명령어의 경로를 확인한다.)




which

명령어의 경로를 확인하는 명령어이다.
리눅스에서 명령어의 경로와 도움말에 대한 명령어는 which, whereis, whatis, man, find등이 있다. 이중에서 명령어의 경로를 확인하는 가장 일반적인 명령어가 which이다.
흔히 호스팅서버등에서 perl의 경로를 찾는 방법으로 "which perl"과 같은 형태로 사용한다.

사용형식

which [options] [--] programname [...]

사용예 #1

간단히 perl의 경로를 확인하고자 한다면 다음과 같이 한다.

[root@host1 commmand]# which perl
/usr/bin/perl
[root@host1 commmand]#

즉, perl의 경로를 확인코자한다면 "which perl"이라고만 하면 된다.

다음은 netstat이라는 명령어의 명령어 경로를 확인한 것이다.

[root@host1 commmand]# which netstat
/bin/netstat
[root@host1 commmand]#


사용예 #2

이번에는 웹서버나 호스팅서버에서 사용자들이 자주 찾는 명령어 경로를 확인하는 예이다.

[root@host1 commmand]# which sendmail
/usr/sbin/sendmail
[root@host1 commmand]#
[root@host1 commmand]# which find
/usr/bin/find
[root@host1 commmand]#
[root@host1 commmand]# which telnet
/usr/bin/telnet
[root@host1 commmand]#
[root@host1 commmand]# which ssh
/usr/bin/ssh
[root@host1 commmand]#
[root@host1 commmand]# which ftp
/usr/bin/ftp
[root@host1 commmand]#

위의 예는 차례대로 sendmail, find, telnet, ssh, ftp의 명령어 경로를 확인한 예이다.

which 명령어에도 다른 명령어들과 마찬가지로 여러가지 옵션들이 있으나 실무에서는 거의 사용하지 않는 것들이다. 따라서 which 명령어의 설명에서 옵션 사용의 예는 생략하도록 하겠다.


크리에이티브 커먼즈 라이센스
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/190

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

« Previous : 1 : ... 6050 : 6051 : 6052 : 6053 : 6054 : 6055 : 6056 : 6057 : 6058 : ... 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:
186866
Today:
335
Yesterday:
789