Chinaunix首页 | 论坛 | 博客
  • 博客访问: 239308
  • 博文数量: 91
  • 博客积分: 2010
  • 博客等级: 大尉
  • 技术积分: 955
  • 用 户 组: 普通用户
  • 注册时间: 2007-08-12 09:38
文章分类

全部博文(91)

文章存档

2017年(1)

2011年(1)

2008年(15)

2007年(74)

我的朋友

分类: LINUX

2007-08-19 15:09:09

commonly used less and man commands
space scroll forward one screen
d scroll forward one-half screen
enter scroll forward one line
b scroll backward one screen
u scroll backward one-half screen
y scroll backward one line
g go to the begin of the text(coule be slow with large amounts of text)
G go to the end of text.
/pattern search forward for pattern,which can be a regular expression.
?pattern search backward for pattern,which can be a regular expression
h display a help screen
:n display next file from command line(two-character command)
:p display previous file from command line(two-character command)

2.man
format and display manpage from manual(手册,指南,手动的,手工的) section on the topic of command using a pager.if section is omitted,the first manpage found is displayed.
-a normally,man exits after displaying a single manpage.the -a option instructs man to display all manpages that match name.in a sequential fashion.
-d display debugging information
-w pring the location of manpages instead of displaying them.

example:
man -wa mkfifo

manual sections are numbered 1 through 9 and N,they are searched in the order shown in table:
1 executeable program or shell commands
2 system administration commands
3 library calls
4 special files(usually found in /dev)
5 file formats and conventions
6 games(sorry,no Quake
7 macro packages and conventions
9 kernel routines
N Tcl/Tk commands

3.standard manpage headings
Name           the name of the item,along with a description
synopsis         a complete description of syntax or usage
description       a brief description of the item
options           detailed information on each command-line option(for commands)
return values      information on function return values(for programming references)
see also         a list of related items that may be helpful
bugs           descriptions of unusual program behavior or known defects
files           a list of important files related to the item,such as comfiguration files.
copying or copyright        a description of how the item is to be distributed
authors         a list of those who are responsible for the item.


write system documentation
  you may want to start with an manpage to use as a template.to do this,simply find a manpage that makes a suitable starting point and copy kit to the appropriate name in the appropriate man directory.again,the name must have the trailing dot and man section.for example,we could copy the existing file /usr/man/man1/ln.1 to /usr/local/man/man1/mycmd.1
  macro    funtion
  .TH    a manpage header.include title,section,date,description,and author
  .SH    a section heading.you can add your own sections to the standard sections as required.
  .pp    a paragraph separator(区分者,分离器). without this macro,lines of text will flow together.
  .TP    a hanging indent macro,used for command options
  .B     everything on the line following this macro is bold
  .I    everything on the line following this macro is italic(斜体)(or sometimes underlined)
  \fb    this inline(描边,内连) macro makes text following on the line bold
  \fI    this inline macro makes thet following on the line italic(or sometimes underlineed )   
  \fR    this inline macro returns the text to the default style
修改/etc/man.config
  在这个文件中,可以添加man的默认搜索路径

阅读(428) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~