2008年7月18日星期五

manpages

一直不知道 manpages 里面是啥,发现基本全是文档,这里从里面比较有意思的地方节选一些出来。这是 manpages 的主页

sync
将文件同步到磁盘。比如 U 盘拔掉之前,sync 一下 umount 就结束了,否则 umount 会调用 sync。

tzselect
选择 time zone,根据用户输入信息输出一个可以设置为 TZ 变量的值。

intro (man 1)
介绍 user commands 和工具,如文件管理、shells、编译器、浏览器、文件图片浏览器、编辑器等。多数程序成功返回 0,失败返回非 0(一般是正数)。
intro (man 2)
介绍 system call,不过多数 system call 都用 C 或者其他的 lib wrapper 调用。多数成功返回 0,不成功返回负值。
intro (man 3)
库函数手册,比如 libc、libm 等。
intro (man 4)
介绍特殊文件,主要是 /dev/ 里面的。
intro (man 5)
介绍文件格式和协议,乃至一些 C 的结构。
intro (man 6)
介绍游戏,系统里面一些搞笑的小程序。
intro (man 7)
介绍习惯、字符集、标准文件系统布局。
intro (man 8)
多仅被超级用户使用的命令,管理命令,硬件相关的命令等。

uri, url, urn
介绍 Uniform Resource Identifier(包括 URLocation 和 URName)。基本格式就是 scheme://path 这种了。常见的有 http、ftp、gopher、mailto、news、telnet、file、man、info、whatis、ldap、wais 等。甚至还有 eMule 等的 scheme。

iso_(-)8859-(_)1...iso_8859-16, latin1-2
是讲述 iso 8859-9 编码。

ipv6, PF_INET6
讲述对应 socket 编程在 C 的结构体。

mq_overview
讲述如何使用 POSIX 消息队列,这是和 SVID 不同的一个,通过她可以让进程之间互相通信,几个重要函数是 mq_open 打开一个队列获得 message queue discriptor,通过 mq_send 和 mq_receive 收发信息,最后 mq_close 关闭该队列(另外还有一系列函数)。通信双方通过 /name 确定队列。连接时 -rt。

mailaddr
关于电子邮件地址的说明。

x25, PF_X25
关于 X.25 协议的 socket 结构。

feature_test_macros, ftm
为写出某些特点的程序写的测试 macros,见 /usr/include/features.h,比如要求是标准 ANSI C 的环境,可以用宏 __STRICT_ANSI__ 来测试,另外可以测试是否满足 SVID 等扩展版本,这在 GNU libc 里面有一些例子,因为 libc 允许根据这些宏判定某些函数是否被是用,通过这些测试可以避免不适当的引入某些函数。

regex, re_format
讲述的 POSIX.2 的正则表达式的基础语法。

spufs
是 PowerPC 上的文件系统的挂载命令。

undocumented
未收入 man page 的说明。

raw, SOCK_RAW
见前

LDP
关于 The Linux Documentation Project 的介绍,有官网 http://tldp.org

bootparam
如何设定 kernel 在 boot 时候的参数:一个 option 一共只能给 10 个参数,格式为 name=val1,val2...,如果 name 是一些已知的名字如 init、root 等会调用对应的 *_setup() 进行配置,否则当作环境变量进行处理。下面是一些常用的名字:init 指定启动后执行的第一个进程位置,一般来说会尝试 /sbin/init、/etc/init、/bin/init 和 /bin/sh,如果全部失败了就会导致 kernel panic;nfsaddrs 指定 NFS 的地址,用于网络启动;nfsroot 指定挂载 NFS 分区为网络启动的 root;no387 关闭对 math coprocessor 的支持;no-hlt 关闭对 HALT 指令的支持;root 指定挂载为 / 的设备;ro/rw 让 / 为只读或者可读可写;reserve=iobase,extent[,iobase,extent] 保留某些 I/O 端口不做 probe;mem 设定内存大小;panic=N 表示发生 kernel panic 后 N 秒重启;reboot=[warm|cold][,[bios|hard]] 设定 reboot 方式;nosmp 取消 SMP,maxcpus=N 设定最多使用的 CPU 个数;debug 打开调试信息;profile=N 打开 kernel profile 功能;swap=N1,N2,N3,N4,N5,N6,N7,N8 设定 swap 相关参数;buff=N1,N2,N3,N4,N5,N6 设定 buff 信息;load_ramdisk=N 设置是否使用 ramdisk;prompt_ramdisk 是否从软盘读入 ramdisk;ramdisk_size=N 设定 ramdisk 大小(单位 Kb);ramdisk_start=N 设定 ramdisk 的起始位置(在软盘上存在 kernel 和 ramdisk 的时候使用);noinitrd 不使用 initrd。另外还可以设定一些 SCSI 设备的参数。

missing
丢失的文档。

boot
讲述 boot 的过程。首先是机器上电,BIOS 自检,从 CMOS(其实叫 NVRAM 更好)读取配置,然后从 boot device 读入 os loader,将控制权交给 os loader。PC 上面一般放在 MBR 里面,由于 MBR 仅有 512 字节,且还含有 64 字节的分区表信息,所以 os loader 往往将自身的一部分放在 MBR 然后引导另一部分,同时根据引导 kernel 的参数将控制权交给 kernel。如果有 initrd 则会将其转换成为 ramdisk 并挂载成为临时的 /,然后执行 /linuxrc,最后挂载了 / 之后就可以执行 init 进程了。init 根据 /etc/inittab 决定运行级别,一些服务放在 /etc/rc?.d/ 里面,其实是到 /etc/init.d/ 里面脚本的连接。

tcp
讲述 tcp 的 C 接口。

netlink, PF_NETLINK, rtnetlink, NETLINK_ROUTE
讲述 PF_NETLINK 编程。

posixoptions
介绍了 POSIX 标准下的函数接口,一般可以用宏在编译时检测,也可以用 sysconf()、pathconf()、fpathconf() 和 confstr() 来检测。

netdevice
设定 interface 的 C 接口。

futek
关于快速用户空间互斥锁。

man(7)
其实是说如何写 man page,通过 groff 输出成为 ASCII 或者 PS。

packet, PF_PACKET
如何产生一个 PF_PACKET 的 C 接口。

mdoc
man page 的另外一种格式,也是通过 groff 转换的。

arp
介绍 arp 命令管理本地 MAC-IP 转换的表,如 arp -n 列出现在的 ARP 表,-d 删除,-s 添加表项。

ip(7)
介绍 IP 的 C 接口。

signal
介绍常用的信号以及 POSIX 信号。

socket
介绍 socket 的 C 接口。

glob
介绍 bash 通过 wildcard 匹配的规则。这个不是 RE,比较简单。

charsets
介绍最常用的字符集、编码方式等。

ascii
介绍 ascii 编码。

standards
介绍 Unix/Linux 里面各种 C 编程的标准。

hier
介绍 Linux 目录树。

koi8-r
是俄文常用编码。

locale(7)
介绍的是 locale 的 C 接口。

pthreads
介绍的是 POSIX threads 的 C 接口。

pty, pts, ptmx, tty(4), tty_ctl
介绍 pseudo-terminal 两种类型(Unix 98 和 BSD,前者使用较多)以及使用方式。pts 讲述 Unix 98 的 master 和 slave 关系,如何通过 C 接口实现。tty 是讲述 /dev/tty 设备。tty_ctl 是 tty 的 ioctl。

epoll
对 edge-triggered 或者 level-triggered 的 IO 事件响应的一种实现,和 poll 类似。

capabilities
这是对原有线程访问模型的一个增补(原来只要 UID 为 0 就无敌了),在 2.6.14 以后的内核中出现的,以后内核对这部分进行检查、并提供了对应的系统调用更改这些,问题是现在还没有获得文件系统的支持。

fifo
介绍 FIFO(这里是 named pipe) 的使用。

symlink
讲述符号连接操作的习惯相关的 C 函数。

complex
讲述 GNU libc 里面 complex.h。


time(7)
讲述各种可用的时钟。

icmp, IPPROTO_ICMP
讲述 ICMP 协议。

termio
是驱动 terminal 的一些东西,已经 obsolete,被 termios 代替。

suffixes
常见“扩展名”

hostname(7)
讲 hostname 解析。

path_resolution
讲述 Linux 如何解析一个路径名称。

operator
C 语言使用 operator 列表及优先级。

unicode
讲述 unicode。

sem_overview
讲述 POSIX semaphore(用于同步)。

ddp
Linux 下 AppleTalk 协议的 C 实现。

unix, PF_LOCAL, AF_LOCAL, PF_UNIX
讲述 unix socket(PF_UNIX)。

man-pages
写 man page 的惯例。

units
介绍计算机上常用的关于大小的前缀,如 kb mb gb 等等。

environ
讲述 C 程序传递 argc、argv 之外的 environ。

credentials
讲述用户、进程的标识。

inotify
讲述监督文件、目录等文件系统事件的 C 接口程序。

utf-8, utf8
讲述 utf-8 编码。

udp
讲述 udp 协议的 C 接口。

shm_overview
讲述 POSIX shared memory(共享内存)。

svipc
讲述的是 SVID 下 IPC 实现机理。

pipe
讲述的是 pipe 和 FIFO 的使用。

mem, kmem, port
介绍 /dev/mem、/dev/kmem 和 /dev/port,mem 一般是物理内存,而 kmem 是内核虚拟内存,port 用于访问物理端口。

random, urandom
介绍 /dev/random 和 /dev/urandom,它们维护一个 entropy pool,根据这个产生随机序列,前者在 entropy 足够高时返回,否则 block,而后者立即返回,因此需要比较高质量的随机序列时应多用 /dev/random。一般用 dd 从这些设备获得需要的随机数。

console_ioctl
设定 console 的 ioctl 参数。

ttyS, ttys
讲述 /dev/ttyS 设备(串口)。

hd(4)
讲述 /dev/hda 到 /dev/hdd 这四个 IDE 硬盘设备。

mouse(4)
讲述 ps/2 鼠标各个 pin 的作用,相关的协议。

st
讲述 SCSI 磁带的 C 语言接口。

full
讲述 /dev/full 设备,如果写可以触发 disk full,读只能读出 \0。

dsp56k
是 Motorola dsp56k 设备的 ioctl。

lp(4)
是 line printer device 的 ioctl。

sk98lin
是讲述 Marvell 和 SysKonnect G 以太网网络适配器的模块。

sd
讲述 SCSI 设备的 ioctl。

initrd
是 /dev/initrd 设备,对应的是 boot loader 加载的 initrd 的 ram disk。

wavelan
是 NCR、AT&T、Lucent WaveLAN ISA 和 Digital (DEC) RoamAbout DS 无线网卡适配器的模块说明。

ram
是 /dev/ram 设备。

rtc
是 real-time clock 的 C 接口和 ioctl。

null, zero
讲述 /dev/null 和 /dev/zero 设备。

console_codes
介绍 Linux console 里面的控制字符等。

vcs 和 vcsa
是虚拟 console 内存,对应 /dev/vcs*。

hosts.equiv
介绍 /etc/hosts.equiv 文件,这是控制 r* 系列命令的登录权限的文件。

mailname
介绍 /etc/mailname 文件,写的是系统对外可见的邮件名。

motd
介绍 /etc/motd,就是登录后显示每日的消息。

tzfile
介绍 tzfile.h 里面关于时区的信息。

securetty
介绍 /etc/securetty,也就是系统认为是安全的 tty,这可以限制 root 通过不安全的途径登录。

rpc
介绍 /etc/rpc,也就是 remote procedure call(远程过程调用),里面记录了 rpc 号以及对应的服务。

elf
是介绍 ELF 文件格式的 C 接口(elf.h)。

shells
介绍 /etc/shells 文件,里面是所有合法的 shells,包括路径等,这使得 chsh 能安全的工作。

host.conf
配置如何解析主机名,即 resolver library。

proc
介绍 proc 文件系统。

resolv.conf, resolver
配置 DNS 的文件,但是现在多用动态方式生成。

group
组信息,介绍 /etc/group 文件。

acct
介绍 sys/acct.h 的用法,用于进程 accounting(内核会在进程结束后写该进程的一些相关信息到某文件)。

locale(5)
解释 locale 是怎么用的(不是解释这个命令)。

nsswitch.conf
用来查询用户帐号信息,如选择 /etc/passwd、nis 或者别的什么。

services
讲述文件 /etc/services,这在 C 程序里面可以用一些对应的命令获得查询。

slabinfo
讲述 /proc/slabinfo,这个文件是 kernel 管理的 slab 的统计信息(常用的一些如 buffer heads、inode 等)。

charmap
charmap 就是用于定义哪些字符属于某个 charset 的文件。

hosts
讲述/ etc/hosts 文件。

utmp, utmpx, wtmp
记录用户登录信息的文件,也就是 /var/run/utmp 的用法。

nologin
介绍 /etc/nologin 拒绝用户登录的文件。

core
介绍 core dump 信息怎么用于调试。

filesystems, fs
介绍常用的 file systems。

termcap
介绍 /etc/termcap,描述了每个 term 的特性。

dir_colors
通常 ls 命令依据 LS_COLOR 设定颜色,这通过 dircolors 命令设定。用户可以根据自己的爱好定义。

issue
讲述 /etc/issue,即在出现提示符前出现的文件。

networks
讲述 /etc/networks,即网络名和对应地址的映射。

protocols
讲述 /etc/protocols 文件,即一些协议对应的网络端口以及别名。

motd.tail
在 debian 里面这是 bootmiscs.sh 生成 motd 的源程序,应该修改它获得永久的效果。

ld-linux, ld-linux-so
这是 Linux 的动态库连接程序,一方面会把需要的 so 文件载入内存,另一方面修改进程相关内容完成动态连接。

相关程序:
sync 来自 coreutils,在 man 1 里面也有。
tzselect 来自 libc6,在 man 1 里面也有。

11 条评论:

匿名 说...

Thіs site was... hоw dο you ѕаy it?
Relevаnt!! Finally I havе founԁ sοmething that helped me.
Mаny thаnkѕ!

Fеel free tо suгf tо
mу ωebрage :: v2 cigs review
Also see my page: Visit the up coming document

匿名 说...

This iѕ a gгeat tiр particulагlу to thοѕe new tο
the blogoѕphere. Ѕimple but veгy precіse information…
Manу thankѕ for sharing thiѕ one.

А must rеaԁ artiсle!

Stop by my webpage: crew.valkry.com
Also see my page > Click The Next Website Page

匿名 说...

Heya fantastic ωеbsitе! Dοes running a blog
such as this гequire a masѕive amount worκ?

I have no knοωleԁge οf cοding howevеr
ӏ ωaѕ hoрing tο start mу oωn blοg in the near future.
Anyhow, if you have аny suggеstions or tiρs foг neω blog oωnеrs pleаse ѕhaгe.
I knοw thiѕ is off topic but I simρly
nеeded to aѕk. Thanks a lot!


Haνe а look at my ωebѕіte: v2 cig review

匿名 说...

Quality cоntent is the sеcret to be a focus for the viewers tο pay a quісk visit
the site, thаt's what this web site is providing.

Also visit my website :: Otwartakultura.ekyo.pl

匿名 说...

Ηеllο, Ӏ check your blοg regulаrly.
Your ωriting style is awesоmе, keep doing ωhat yоu're doing!

Here is my web site; V2 Cigs reviews

匿名 说...

I think this is among thе ѕuch a lot vital infоrmаtiοn
for mе. And i am happy rеading your агticle.
Нoweνer wаnna гemark οn some
normаl things, Thе website tаѕte is рerfeсt, the articles iѕ in reаlіtу niсe : D.
Excellent tаsk, chеers

my blog :: http://www.sfgate.com/business/prweb/article/V2-Cigs-Review-Authentic-Smoking-Experience-or-4075176.php

匿名 说...

Hi to every onе, it's actually a pleasant for me to go to see this web site, it consists of precious Information.

Look at my site: just click the up coming internet page

匿名 说...

I favor Luci E cigs

Hаve a look at my wеblog - green smoke coupon codes

匿名 说...

Cigarеttеѕ ωeгe a great obsesѕion for me pегsonallу.

I developed thіѕ behavior since my teen cover.
It changeԁ into a cursе foг me if this stагted іmpaсting
mу well being. I was a chain smokег given thаt my universitу days.
This κind of had tο impасt my bloοԁ pressure
levels, renal system, brеathing аnԁ
caгԁiac conditіon. Rеmaгkаblу, a еxpensive fгiеnd of mine introducеd mе tо the taѕtіng еlectronic
сigarettes thгοugh Green Smoκe cigаrettes.
Ι wouldn't listen to him until I tried one myself. I am out of the loss of life bed right now and over the tobacco cigarettes completely. Vapor smoking did what the rehabs did not do.

Stop by my page green smoke coupon code

匿名 说...

ωondeгful put up, very informative.

ӏ ponԁer why the oppoѕite specialists of this
sectoг do not notice this. You must continue your writing.
I am confident, уou have a hugе reaԁerѕ' base already!

Here is my webpage V2 Cigs Reviews

匿名 说...

Many therapeutic lotions incorporate calcium milk powder.
The instructions of the usage and the total to be used are
normally outlined on the pack.

Also visit my weblog ynhfjl.com