본문 바로가기
WEB/Linux

명령어(find, locate)

by Zayne 2024. 1. 28.

파일을 찾을 때 유용하게 쓸 수 있는 명령어이다.

 

1. find

find <directory> <option> <name>

 

find 명령어 관련 예시이다.

find . -name "Jerry"

 

.(dot) 은 현재 위치해 있는 디렉토리 기준으로 "Jerry" 라는 파일 찾는 명령어이다.

위치를 전혀 모르는 경우에는 .(dot) 대신 /(slash)를 이용하면 root directory 밑으로 전체 경로를 다 찾을 수 있다.

 

 

2. locate

locate <file-name>

 

locate 명령어를 통하여 경로 지정없이 해당 파일의 위치를 쉽게 찾을 수도 있다.

'WEB > Linux' 카테고리의 다른 글

Wildcards  (0) 2024.01.29
Difference between find and locate  (0) 2024.01.29
명령어(touch, cp, vi, mkdir)  (1) 2024.01.28
Linux File Properties  (0) 2024.01.27
원격 연결  (0) 2024.01.26