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

man (명령어 도움말(메뉴얼)보기)

작성자 정보

  • 웹관리자 작성
  • 작성일

컨텐츠 정보

본문

man

man 명령어는 리눅스의 명령어 메뉴얼을 확인할 수 있는 명령어이다.
즉, 리눅스 명령어의 도움말, 사용법, 각종 옵션, 사용환경, 버그, 제작자등을 확인할 수 있는 명령어이다.

서버관리를 수년간 해온 필자도 잘 사용하지 않던 리눅스 명령어를 사용하고자 할 때에는 man페이지를 확인한다.
리눅스 명령어의 man페이지에 나오는 모든 개별명령어의 옵션들과 사용법을 모두 알고 활용하는 관리자가 얼마나 될까? 아니 필자는 없다고 생각이 될 정도로 개별 명령어의 모든 옵션과 그 사용법을 숙지하고 있는 관리자는 더물다.

따라서 서버관리를 할 때에는 필요할마다 가끔씩 man페이지를 확인하곤 한다.
따라서 man페이지의 활용방법은 서버관리자에게는 필수라 할 수 있으며 서버관리자로 입문하는 사람이라면 필히 그 사용법을 익혀 두어야한다.


명령어 사용형식

       man  [-acdfFhkKtwW]  [--path]  [-m system] [-p string] [-C config_file]
       [-M pathlist] [-P pager] [-S section_list] [section] name ...

명령어 위치 : /usr/bin/man

관련명령어 : apropos(1), whatis(1), less(1), groff(1), man.config(5).


man페이지 파일들의 보관위치

man페이지는 리눅스서버의 특정위치에 파일로 보관되어 있으며 사용자의 요구(시스템호출)이 있을 경우에 요구된 man페이지만 출력하게 된다.
리눅스 서버에서 man페이지파일을 보관하고 있는 위치는 아래와 같이 몇가지가 있다.

/usr/local/share/man
/usr/share/man/ko
/usr/share/man
/usr/X11R6/man

위의 디렉토리를 확인해 보면 알겠지만 압축된 파일형태로 man페이지파일들이 존재하고 있으며 위의 man페이지파일 보관 디렉토리에는 man1, man2등과 같은 이름으로 용도에 따라 man페이지파일들이 보관되어 있다.


또한 특정명령어의 man페이지 위치를 확인코자 한다면  manpath 명령어를 사용한다.
즉, manpath명령어는 man페이지 위치경로를 검색하여 표시해주는 명령어이다.

다시말해서 특정명령어의 man페이지파일이 존재하는 위치를 찾는 검색경로를 확인할 수 있는 명령어이다.

따라서 man명령어와 함께 특정 명령어의 man페이지 위치를 알려주는 명령어인 manpath라는 명령어도 함께 알아두기 바란다. 


사용예 #1

간단히 man페이지의 사용예를 알아보자.

FIND(1L)                                                              FIND(1L)

NAME
       find - search for files in a directory hierarchy

SYNOPSIS
       find [path...] [expression]

DESCRIPTION
       This  manual page documents the GNU version of find.  find searches the
       directory tree rooted at each given file name by evaluating  the  given
       expression  from  left  to  right, according to the rules of precedence
       (see section OPERATORS), until the outcome is known (the left hand side
       is false for and operations, true for or), at which point find moves on
       to the next file name.

       The first argument that begins with `-', `(', `)', `,', or `!' is taken
       to  be  the  beginning  of  the expression; any arguments before it are
       paths to search, and any arguments after it are the rest of the expres-
       sion.   If  no  paths  are given, the current directory is used.  If no
       expression is given, the expression `-print' is used.

       find exits with status 0  if  all  files  are  processed  successfully,
       greater than 0 if errors occur.

EXPRESSIONS
       The  expression  is  made up of options (which affect overall operation
       rather than the processing of a specific file, and always return true),
       tests  (which  return  a  true or false value), and actions (which have
       side effects and return a true or false value), all separated by opera-
       tors.   -and  is assumed where the operator is omitted.  If the expres-
       sion contains no actions other than -prune, -print is performed on  all
       files for which the expression is true.

   OPTIONS
       All  options  always return true.  They always take effect, rather than
:


위의 예는 find라는 명령어의 메뉴얼페이지를 확인해본 것이다. 이처럼 man페이지는 간단히 "man 명령어" 라고만 하면 쉽게 그 명령어의 메뉴얼을 볼 수 있다.

 

저작권 :  수퍼유저코리아 (www.superuser.co.kr),   무단 재배포및 복사를 금합니다.

관련자료

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

공지사항


뉴스광장


  • 현재 회원수 :  60,042 명
  • 현재 강좌수 :  35,846 개
  • 현재 접속자 :  139 명