Views 30715 Votes 0 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
90 System/OS [linux] 콘솔 기본언어 설정 방법 hooni 2013.04.23 12876
89 System/OS [linux] 콘솔/Xwindow 에서 PC스피커 소리 없애기 hooni 2003.04.23 16416
88 System/OS [linux] 터미널에서 문자 깨질 때 설정 ㅋㅋ hooni 2003.04.23 13963
87 System/OS [linux] 텔넷, FTP 텍스트 모드에서 사용 hooni 2003.04.23 11993
86 System/OS [linux] 특수문자 환경 설정(stty) hooni 2003.04.23 15342
» System/OS [linux] 특정 문자열 포함된 파일 찾는 명령어 hooni 2013.10.16 30715
84 System/OS [linux] 파일내 문자열 찾아 바꾸기 hooni 2013.04.23 12263
83 System/OS [linux] 패킷 스니퍼링 hooni 2003.04.23 16378
82 System/OS [linux] 패킷의 소스 주소 바꾸기 hooni 2003.04.23 18853
81 System/OS [linux] 프로그램 설치방법 (내공쌓기) hooni 2003.04.23 13485
80 System/OS [linux] 프로세스 상태확인(ps) hooni 2003.04.23 12768
79 System/OS [linux] 프로세스의 stat 상태에 대한 설명 hooni 2013.04.23 10829
78 System/OS [linux] 한글 URL 인식할 수 있게 아파치(Apache) 설정 (mod_url.c 설치) hooni 2013.04.23 13139
77 System/OS [macos] How to Fix ‘You Shut Down Your Computer Because of a Problem’ file hooni 2022.06.01 941
76 System/OS [mac] Charlesproxy 간단한 설정 내용~ hooni 2013.11.12 12432
75 System/OS [mac] Homebrew/rvm/cocoapod setting hooni 2017.07.29 1167
Board Pagination Prev 1 ... 6 7 8 9 10 13 Next
/ 13