Views 30716 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 해 준다.

?

  1. [java] 입출력 스트림 3부 (오브젝트)

    Date2013.04.23 CategoryDevelop Byhooni Views17176
    Read More
  2. [java] 입출력 스트림 1부 (문자)

    Date2013.04.23 CategoryDevelop Byhooni Views15348
    Read More
  3. [android] Canvas를 이용해 이미지 확대/축소 하기

    Date2013.04.23 CategoryDevelop Byhooni Views60791
    Read More
  4. [java] 스트러츠(Struts) 세팅 ㅋㅋ

    Date2013.04.23 CategoryDevelop Byhooni Views42395
    Read More
  5. [linux] 리눅스 파일시스템과 디렉토리 설명

    Date2013.04.23 CategorySystem/OS Byhooni Views26935
    Read More
  6. [linux] 리눅스, 유닉스 CPU 이용률 확인..

    Date2013.04.23 CategorySystem/OS Byhooni Views23853
    Read More
  7. [linux] 리눅스,유닉스 /proc/stat 파일 보는 법

    Date2013.04.23 CategorySystem/OS Byhooni Views18014
    Read More
Board Pagination Prev 1 2 Next
/ 2