Contents

Views 33084 Comment 0
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
만약 특정 디렉토리 이하에서 network 라는 문자열을 포함한 파일을 찾고싶다면.. 해당 디렉토리에서 모든 파일을 읽어 찾아보아야 하나.. 다음과 같이 find 와 grep 를 파이프로 연결하여 사용하면 쉽게 찾을 수있다. 

# /etc/ 디렉토리 하위에서 'network' 문자열이 포함된 파일 찾기
find /etc/ -type f -exec grep 'network' {} /dev/null \;

# /etc/ 디렉토리 하위의 파일명 '*.conf' 중에서 'network' 문자열이 포함된 파일 찾기
find /etc/ -name '*.conf' -type f -exec grep 'network' {} /dev/null \;


위와 같이 명령어를 타입하면 /etc/ 디렉토리 이하에서 network 라는 문자열을 포함한 모든 파일명과 위치를 listing 해 준다. 


그리고 단순히 특정 단어를 포함한 파일명을 찾고 싶으면 locste 라는 것을 쓰면 된다.
즉, locate ftp 를 하면 ftp 라는 파일명이 포함된 파일들을 listing 해 준다.


?

List of Articles
No. Category Subject Author Date Views
144 System/OS [linux] 메타(기호)문자의 의미와 사용 hooni 2003.04.23 17267
143 System/OS [linux] 프로세스 상태확인(ps) hooni 2003.04.23 13544
142 System/OS [linux] 종료와 종료코드 확인(환경변수에서) hooni 2003.04.23 16903
141 System/OS [linux] 셀 스크립트 if, for, case in.. hooni 2003.04.23 14493
140 System/OS [linux] 스케쥴링 순서(nice) 변경하기 hooni 2003.04.23 13375
139 System/OS [linux] 기존 환경설정 저장하면서 커널 컴파일.. hooni 2003.04.23 14441
138 System/OS [linux] Proftpd 설치 가이드 hooni 2003.04.23 13844
137 System/OS [sql] 내 방명록 답글 찾는 쿼리문.. (JOIN 구문) hooni 2003.04.23 13775
136 System/OS [sql] alter table 쿼리 예제 hooni 2003.04.23 13314
135 System/OS [dos] 노트북 백업 스크립트 xcopy 명령 예제 hooni 2003.04.23 41792
134 System/OS [linux] 터미널에서 문자 깨질 때 설정 ㅋㅋ hooni 2003.04.23 14611
133 System/OS [linux] root도 삭제하지 못하는 파일 속성 hooni 2003.04.23 13168
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 17 Next
/ 17