Welcome 微信登录

首页 / 操作系统 / Linux / Linux的man那点事

用过linux的朋友估计没有谁不熟悉man命令,大家都知道利用它可以查看到linux绝大部分命令的使用方法(但不是全部),除了这个你还了解它什么呢?其实了解man可以查看其它命令的使用方法就掌握了它的核心,但是最近看书的时候又找到了它的一点其他信息。哈哈,你就将这篇文章当做扯谈吧!~1. man其实是manual的缩写(不会很多人认为它是"男人"吧),表示手册、指南的意思。2. 其实man也包含8个部分。man1: User programsManual pages that describe publicly accessible commands are contained in this chapter. Most program documentation that a user will need to use is located here.man2: System callsThis section describes all of the system calls (requests for the kernel to perform operations).man3: Library functions and subroutines Section 3 describes program library routines that are not direct calls to kernel services. This and chapter 2 are only really of interest toprogrammers.man4: Special filesSection 4 describes the special files, related driver functions, and networking support available in the system. Typically, this includes the device files found in /dev and the kernel interface to networking protocol support.man5: File formatsThe formats for many data files are documented in the section 5. This includes various include files, program output files, and system files.man6: GamesThis chapter documents games, demos, and generally trivial programs.Different people have various notions about how essential this is.man7: Miscellaneous Manual pages that are difficult to classify are designated as being section 7. The troff and other text processing macro packages are found here.man8: System administration Programs used by system administratorsfor system operation and maintenance are documented here. Some ofthese programs are also occasionally useful for normal users.我们平常主要用到的是man1和man5,当我们敲出man命令时,www.linuxidc.com默认的就是man1,例如man ls实际上等价的就是man 1 ls。这是最常用的,此时man会告诉我们这个命令(程序)的用法。而平常也偶尔会用到man5,比如你要查看/etc/fstab这个文件里面每一行每一列的的解释那么你就可以使用 man 5 fstab。那么你就可以得到相关解释信息。至于其他的man,估计很少会用到。
这些man的所对应的信息都是在/usr/share/man/这个目录下:xxx@db-2:~$ ls /usr/share/man
cs  de  es  fi  fr  gl  hu  id  it  ja  ko  man1  man2  man3  man4  man5  man6  man7  man8  nl  pl  pt  pt_BR  ru  sv  tr  zh_CN  zh_TW
其实每个manx的目录下的每个文件都是程序名或者称为命令名+x+.gz组成的,你解压之后可以看到里面是文本信息。另外,我们在man查看命令使用方法时,经常会看到第一行有command(数字),还有最后的SEE ALSO部分也是command(数字)这种信息,其实括号里面的信息就是表面你可以通过man 数字 command可以查看到相关信息,比如 man mkfs。好了。Linux sudo命令与其配置文件/etc/sudoersLinux下防止进程使用swap及防止OOM机制导致进程被kill掉相关资讯      Linux命令 
  • 48 字节命令可令 Linux 系统当机!  (今 07:55)
  • 在Linux笔记本上执行这句命令能致  (02月02日)
  • .NET开发必会的Linux命令  (12/20/2015 10:32:03)
  • 运维工程师必会的109个Linux命令  (03月09日)
  • 有趣的Linux命令行:随机输出唐诗  (12/28/2015 20:14:23)
  • 10 个 Linux 中的 passwd 命令示例  (10/29/2015 10:14:30)
本文评论 查看全部评论 (0)
表情: 姓名: 字数