각종 파일과 디렉토리등의 경로 확인에 자주 사용되는 명령어를 살펴봅니다.
which
which는 특정명령어의 위치를 찾아주는 명령어이다.
Bash
which find
/bin/find
검색 가능한 모든 경로에서 해당 명령어를 찾음
Bash
which -a find
/bin/find
/usr/bin/find
where
whereis는 명령어의 실행파일위치, 소스위치, man 페이지파일의 위치를 찾아주는 명령어이다.
Bash
whereis find
find: /bin/find /usr/bin/find /usr/share/man/man1/find.1.gz
locate
locate는 다양한 패턴의 파일들을 찾고자 할 때 매우 유용하게 사용되는 명령어이다.
현재 시스템에 존재하는 *.bak 에 해당하는 파일 찾기
Bash
locate *.bak
특정패턴에 해당하는 파일들 가운데 지정한 개수만큼 검색
Bash
locate -n 10 *.conf