Contents

Views 30618 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
154 System/OS [linux] yum 업데이트 시 커널 제외하기 hooni 2014.09.11 1264
153 System/OS [linux] resolv.con 초기화 되는 문제 hooni 2014.04.05 4624
152 System/OS [linux] CentOS 6.5 에서 "Bringing up interface eth0: Determining if ip address 121.78.127.197 is already in use for device eth0..." hooni 2014.04.05 4854
151 System/OS [mac] 맥(OSX)에서 NTFS, 윈도우에서 HFS+ 사용하기 file hooni 2014.03.12 5119
150 System/OS [mac] 맥OSX에서 NTFS 쓰기 기능 활성화 hooni 2014.03.12 4288
149 System/OS HTTPS와 SSL 인증서 file hooni 2014.03.11 7548
148 System/OS [linux] split 명령어 hooni 2014.03.11 4307
147 System/OS [linux] awk 명령어 hooni 2014.03.11 4957
146 System/OS [linux] 쉘스크립트 expr hooni 2014.03.11 15622
145 System/OS [linux] CentOS Apache Httpd에 https 적용 hooni 2014.03.05 4483
144 System/OS [linux] CentOS 6.x Cati 설치 (yum) hooni 2014.01.17 48596
143 System/OS [linux] iconv를 이용하여 euc-kr 문서를 utf-8로 대량으로 변환하기 file hooni 2014.01.09 12221
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 17 Next
/ 17