Contents

Views 30715 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
60 System/OS [mac] 맥에서 APM(apache,php,mysql) 구성하기 hooni 2013.04.23 38818
59 PPT [android][ios] 알림(Notification) 기능에 대한 원리와 구현 방안 (APNS포함) file hooni 2013.04.23 37899
58 Etc [svn] 콘솔에서 svn 사용시 레티나용 이미지 add 안될 때.. hooni 2013.09.25 37630
57 Develop [ios] iOS 4.0 beta 에서 3.1.3으로 다운그레이드 하는 법 file hooni 2013.04.23 37540
56 System/OS [mac] Mac에서 Mac으로 원격제어하기 (맥에서 맥으로) file hooni 2013.10.08 37245
55 Develop [lego] 세그웨이 이것만 볼것.. ㅎㅎ file hooni 2013.04.23 33577
54 System/OS [mac] 맥에서 슬립(잠자기) 모드 진입을 막는 방법~ hooni 2013.10.10 31284
53 Develop [android] 디바이스(시뮬레이터) hosts 파일 수정하기 hooni 2013.04.23 31122
» System/OS [linux] 특정 문자열 포함된 파일 찾는 명령어 hooni 2013.10.16 30715
51 Develop [js] 웹페이지에서 특정 엘리먼트 드래그, 복사, 컨텍스트메뉴, 키보드 막기 hooni 2013.11.04 30125
50 Develop [ios] 소소한 팁 (Rect,Point,Path,URL 등) hooni 2013.08.08 29526
49 System/OS [sql] insert into select 사용하기 hooni 2013.04.23 27634
Board Pagination Prev 1 2 3 4 5 6 7 Next
/ 7