강좌
클라우드/리눅스에 관한 강좌입니다.
리눅스 분류

파일내용확인실무 5편: 파일내 문자열 검색(more)

작성자 정보

  • 관리자 작성
  • 작성일

컨텐츠 정보

본문

파일내용확인실무 5: 파일내 문자열 검색(more)

 

 

 

 

 

more명령어로 텍스트파일의 내용을 확인하는 것이 가장 일반적인 사용법이라면 파일내의 특정 문자열을 검색하는 방법은 more의 특별한 기능이라고 할 수 있다.

 

 

 

 , 이번에는 more명령어를 사용하여 파일내의 문자열을 검색하는 방법을 보도록 하자. 다음은 more명령어를 실행한 상태에서 특정 문자열을 검색하는 방법이다.

 

 

 

 

 

      /문자열 : “문자열을 파일내에서 찾아준다.

 

 (주의 : 대소문자 구분함)

 

 

 

아래의 예는 EXAMPLE이라는 파일내에서 “version”이라는 문자열을 검색하는 예이다.

 

 

 

 

 

[root@sulinux ~]#more EXAMPLE

            Writing scripts for Midnight Commander's external vfs

 

IMPORTANT NOTE: There may be some bugs left in extfs. Enjoy.

 

Starting with version 3.1, the Midnight Commander comes with so called

extfs, which is one of the virtual filesystems. This system makes it

possible to create new virtual filesystems for the GNU MC very easily.

 

Such work has two basic steps:

 

Editing $(libdir)/extfs/extfs.ini.

Creating a shell script/program to handle requests.

(Note: $(libdir) should be substituted for actual libdir path stored when

configured or compiled, like /usr/local/lib/mc or /usr/lib/mc).

 

The first one is very easy:

You assign a vfs suffix. For example, if you have .zip file, and would

like to see what's inside it, path will be

 

/version

 

 

 

 

“/version”을 입력하고 Enter키를 입력하면 “version”이라는 문자열이 있는 행을 찾아준다.

 

 

 

 첫번째 문자열이 검색된 후에 다시 n을 한번 입력하면 “system”이라는 문자열을 계속 이어서 찾아주게 된다.

 

 

 

 그리고 한번 찾은 문자열과 동일한 문자열을 계속해서 찾으려면 그냥 n만 입력하면 된다.

 

관련자료

댓글 0
등록된 댓글이 없습니다.

공지사항


뉴스광장


  • 현재 회원수 :  60,043 명
  • 현재 강좌수 :  35,855 개
  • 현재 접속자 :  118 명