[Linux] which, where, locate 명령어

Ogu·2022년 4월 20일
0

🌵 which


which는 사용자의 PATH 환경 변수와 alias, function 에서 명령어의 경로를 찾아주는 명령어이다.

which find

  /bin/find

-a : PATH에 있는 모든 경로에서 검색하게 한다.

which -a find /bin/find /usr/bin/find

출처: https://webdir.tistory.com/158 [WEBDIR]

🌵 where


whereis는 명령어의 실행파일위치, 소스위치, man 페이지파일의 위치를 찾아주는 명령어이다.

whereis find 
find: /bin/find /usr/bin/find /usr/share/man/man1/find.1.gz

🌵 locate


locate는 다양한 패턴의 파일들을 찾고자 할 때 매우 유용하게 사용되는 명령어이다.
ex ) 현재 시스템에 존재하는 *.bak 에 해당하는 파일 찾기

locate *.bak

🌵 locate


profile
Hello! I am Ogu, a developer who loves learning and sharing! 🐤🐤 <br> こんにちは!学ぶことと共有することが好きな開発者のOguです!🐤

0개의 댓글