리눅스 명령어 위치 확인

1. 방법 1: type

리눅스 type 문서를 참고,

[root@localhost ~]# type ifconfig
ifconfig is /sbin/ifconfigCode language: PHP (php)
[root@localhost ~]# type cd
cd is a shell builtinCode language: CSS (css)
[root@localhost ~]# type which
which is aliased to `alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'Code language: PHP (php)

2. 방법 2: witch

리눅스 witch 문서 참고,

[root@localhost ~]# which ifconfig
/sbin/ifconfigCode language: PHP (php)
[root@localhost ~]# which httpd
/usr/sbin/httpdCode language: PHP (php)

ifconfig는 /sbin에, httpd는 /usr/sbin에 설치되어 있다.

3. 방법 3: whereis

[root@localhost ~]# whereis ifconfig
ifconfig: /sbin/ifconfig /usr/share/man/man8/ifconfig.8.gzCode language: PHP (php)
[root@localhost ~]# whereis httpd
httpd: /usr/sbin/httpd /usr/sbin/httpd.worker /usr/sbin/httpd.event /etc/httpd /usr/lib64/httpd /usr/include/httpd /usr/share/man/man1/httpd.1.gz /usr/share/man/man8/httpd.8.gzCode language: PHP (php)

4. 방법 4: find

  • 실제 명령어가 아닌 다른 파일을 찾게 될 수도 있다.
  • 모든 폴더를 다 찾아보기 때문에 위 방법들에 비해 오래 걸린다.
[root@localhost ~]# find / -name ifconfig
/sbin/ifconfigCode language: PHP (php)

참고

http://en.wikipedia.org/wiki/Which_(Unix)
http://en.wikipedia.org/wiki/Whereis

댓글 달기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다

20 + 2 =