예를 들어 내가 입력하면을 man ls볼 수 LS(1)있습니다. 하지만 입력하면 man apachectl내가보고 APACHECTL(8)내가 입력하면 man cd내가 끝낼 cd(n).
괄호 안에있는 숫자의 의미가 무엇인지 궁금합니다.
export MANSECT=0p:1:2:3:3p:4:5:6:7:8:9:l:s:n
예를 들어 내가 입력하면을 man ls볼 수 LS(1)있습니다. 하지만 입력하면 man apachectl내가보고 APACHECTL(8)내가 입력하면 man cd내가 끝낼 cd(n).
괄호 안에있는 숫자의 의미가 무엇인지 궁금합니다.
export MANSECT=0p:1:2:3:3p:4:5:6:7:8:9:l:s:n
답변:
이 번호는 해당 페이지의 매뉴얼 섹션에 해당합니다. 1은 사용자 명령이고 8은 sysadmin입니다. man 자체에 대한 매뉴얼 페이지 ( man man)는이를 설명하고 표준을 나열합니다.
MANUAL SECTIONS
The standard sections of the manual include:
1 User Commands
2 System Calls
3 C Library Functions
4 Devices and Special Files
5 File Formats and Conventions
6 Games et. al.
7 Miscellanea
8 System Administration tools and Daemons
Distributions customize the manual section to their specifics,
which often include additional sections.
섹션마다 다른 페이지를 가진 특정 용어가 있습니다 (예 : printf명령이 섹션 1에 stdlib나타나고 기능이 섹션 3에 나타남). 그런 경우 섹션 번호를 man페이지 이름 앞에 전달하여 원하는 것을 선택하거나 man -a일치하는 모든 페이지를 한 행에 표시하는 데 사용할 수 있습니다.
$ man 1 printf
$ man 3 printf
$ man -a printf
용어가 어떤 섹션에 속하는지 알 수 있습니다 man -k( apropos명령 과 동일 ). 하위 문자열 일치도 수행합니다 (예 : sprintf실행하면 man -k printf표시됨). ^term제한 을 사용 하여 제한해야합니다.
$ man -k '^printf'
printf (1) - format and print data
printf (1p) - write formatted output
printf (3) - formatted output conversion
printf (3p) - print formatted output
printf [builtins] (1) - bash built-in commands, see bash(1)
man X intro섹션에있는 내용을 설명합니다 X.
man man... 지금까지 내가 본 적이 없다 .
이 섹션 번호의 역사는 1971 년 Thompson과 Ritchie 의 원래 Unix Programmer 's Manual 로 돌아갑니다 .
원래 섹션은
pipe(7), tcp(7)(그리고 여러 가지 다른 네트워킹 man 페이지) pthreads(7), boot(7), regex(7), 등 7 항에서 다른 것들과 같은뿐만 아니라,있다 ascii(7)(ASCII 표)와 man(7)(어떻게 사람 페이지를 작성하는)하지만 광범위한 문서 페이지가 지금까지입니다 내 경험에서 섹션 7에서 가장 유용한 것들.
konqueror는 비표준 섹션도 설명합니다 : (아이디어에 대한 @ greg0ire 덕분에)
0 Header files
0p Header files (POSIX)
1 Executable programs or shell commands
1p Executable programs or shell commands (POSIX)
2 System calls (functions provided by the kernel)
3 Library calls (functions within program libraries)
3n Network Functions
3p Perl Modules
4 Special files (usually found in /dev)
5 File formats and conventions eg /etc/passwd
6 Games
7 Miscellaneous (including macro packages and conventions), e.g. man(7), groff(7)
8 System administration commands (usually only for root)
9 Kernel routines
l Local documentation
n New manpages
그것이 의미하는 바는 이미 설명되어 있지만 각 섹션에는 소개가있는 특별한 매뉴얼 페이지가 있음을 추가하고 싶습니다 intro. 예를 들어, 참조 man 1 intro또는 man 3 intro등등합니다.
man-pages패키지가 설치되어 있습니까?
로부터 man맨 :
The table below shows the section numbers of the manual followed by the
types of pages they contain.
1 Executable programs or shell commands
2 System calls (functions provided by the kernel)
3 Library calls (functions within program libraries)
4 Special files (usually found in /dev)
5 File formats and conventions eg /etc/passwd
6 Games
7 Miscellaneous (including macro packages and conven‐
tions), e.g. man(7), groff(7)
8 System administration commands (usually only for root)
9 Kernel routines [Non standard]
왜 그렇게 분리되어 있는지에 대해서는 약간의 중복이 있습니다. 의미에 따라 특정 맨 페이지가 둘 이상의 섹션에 존재합니다.
예를 들어, 비교 man crontab와 man 5 crontab- 기회는 후자는 당신이 보는 것을 의미 하나입니다입니다.
man1p과 man3p?
~/man합니까?
종종 매뉴얼 페이지는 괄호로 묶인 섹션으로 접미사를 통해 참조됩니다. 예 :
read(2)
이 스타일에는 두 가지 주요 장점이 있습니다.
매뉴얼 페이지는 섹션으로 구성됩니다 (예 : 섹션 1에는 모든 사용자 명령 매뉴얼 페이지 포함, 섹션 2에는 시스템 호출에 대한 모든 매뉴얼 페이지 포함), 섹션 3은 라이브러리 기능 등입니다.
명령 행에서 섹션을 명시 적으로 지정하지 않으면 첫 번째 일치하는 매뉴얼 페이지가 기본 섹션 순회 순서로 표시됩니다. 예를 들면 다음과 같습니다.
$ man read
BASH_BUILTINS(1)Fedora에 표시됩니다 . 어디
$ man 2 read
read()시스템 호출에 대한 매뉴얼 페이지를 표시합니다 .
섹션의 위치 지정은 이식 가능하지 않습니다. 예를 들어 Solaris에서는 다음과 같이 지정합니다.
$ man -s 2 read
일반적으로 man man사용 가능한 일부 섹션도 나열됩니다. 그러나 반드시 전부는 아닙니다. 사용 가능한 모든 섹션을 나열하기 위해 기본 man 경로 또는 환경 변수에 나열된 모든 디렉토리의 하위 디렉토리를 나열 할 수 있습니다 $MANPATH. 예를 들어 일부 개발 패키지가 설치된 Fedora 23 시스템 /usr/share/man에는 다음과 같은 하위 디렉토리가 있습니다.
cs es id man0p man2 man3x man5x man7x man9x pt_BR sk zh_CN
da fr it man1 man2x man4 man6 man8 mann pt_PT sv zh_TW
de hr ja man1p man3 man4x man6x man8x pl ro tr
en hu ko man1x man3p man5 man7 man9 pt ru zh
man접두사가 있는 디렉토리 는 각 섹션을 나타내고 다른 디렉토리 에는 번역 된 섹션이 있습니다. 따라서 비어 있지 않은 섹션 목록을 얻으려면 다음과 같은 명령을 실행할 수 있습니다.
$ find /usr/share/man -type f | sed 's@^.*/man\(..*\)/.*$@\1@' \
| sort -u | column
0p 1p 3 4 6 8
1 2 3p 5 7
(로 끝나는 섹션 p은 POSIX 매뉴얼 페이지입니다)
다른 언어 (사용 가능한 경우)로 매뉴얼 페이지를 보려면 언어 관련 환경 변수를 다음과 같이 설정할 수 있습니다.
$ LC_MESSAGES=de_DE man read
또한 각 섹션에는이라는 소개 매뉴얼 페이지가 있어야합니다 intro. 예 :
$ man 2 intro
SVr4의 정의는 다음과 같습니다.
1 User Commands
2 System Calls
3 library Functions
4 File Formats
5 Standards, Environment and Macros (e.g. man(5))
6 Games and Demos
7 Device and Network Interfaces, Special Files
8 Maintenance Procedures
9 Kernel and Driver entry points and structures
이것은 "유전"UNIX의 실제 번호입니다. POSIX는 숫자를 정의하지 않습니다.