-
[Linux] 특정 조건으로 파일 찾기IT Tech/Linux 2021. 2. 2. 13:56
locate [파일명]
- 파일이 위치한 경로를 알 수 있습니다.
$ locate apt-daily.service /usr/lib/systemd/system/apt-daily.service
find [디렉토리] -name [파일명]
- 해당 디렉토리 아래에 있는 파일을 찾을 수 있습니다.
$ find /usr -name apt-daily.service /usr/lib/systemd/system/apt-daily.service
printenv
- 현재 지정된 환경변수를 출력합니다.
echo $PATH
- 환경변수들의 경로인 path를 출력합니다. path들은 모두 :(콜론)으로 구별됩니다.
grep -R -i [문자열] /etc/*
- etc 폴더 안에 있는 파일들 중 [문자열]을 내용물로 포함하는 파일을 찾을 수 있습니다.
find . -name "*.tmp" -exec rm -f {} \;
- tmp로 끝나는 모든 파일을 지웁니다.
'IT Tech > Linux' 카테고리의 다른 글
[Linux] 우분투 패키지 저장소 추가하기 (0) 2021.02.02 [Linux] 파일 접근 허가와 사용자 추가 (0) 2021.02.02 [Linux] 특정 시간에 반복적으로 작업하기 (0) 2021.02.02 [Linux] 서비스 포트 관리 (0) 2021.01.28 [Linux] grep (0) 2021.01.23