View and search Unix/Linux man pages
来源:互联网 发布:微信收红包网络出错 编辑:程序博客网 时间:2024/04/29 22:09
这篇文章转载自:http://www.tuxfiles.org/linuxhelp/manpages.html
< How to use man pages >
If you're wondering how some command is used, or if you want more info about a particular command, you don't usually have to search for some text file that contains the help you need. You can read the reference manual for a command by simply typingman
, and giving the name of the desired command as an argument to it. Yes, it really is so simple! Almost every command on a Linux system has a manual page. For example, if you want more info about thels
command, you just type:$ man ls
Many X programs have man pages, too. For example, the following gives you the man page forxterm
which is a terminal emulator:$ man xterm
The manual page entry is usually so long that it cannot be displayed on your screen all at once. You can use the following keys and commands for moving around in the manual page:
There are manual pages for different programs, utilities, functions and even for some configuration files. For example, the/etc/X11/XF86Config
file is used for your X Window System settings. If you want more info about the file, you just read its manual page:$ man XF86Config
The man pages are a very quick and easy way of getting help. Of course the man
command itself has a manual page entry, so if you want more info about theman
command itself:$ man man
Don't the man pages sound too good to be true? Yes, they do, so there must be a catch. As I said earlier, they'rereference manual pages, which means they're usually very brief and technical. Sometimes they look like encrypted Chinese. The man pages are great if you already know how to use the command and need only a reference or some extra info. They are definitely not tutorials and sometimes they're hard to understand, so they're not the best source of help for a newbie. However, the man pages are very useful because they're always there, only one command away, so you should try to learn to use them. The more man pages you read, the more you start to understand them.
< Searching with apropos >
What if you need to do a specific task but don't know what program or command to use for the task? Every man page entry contains a short description of the program, but the problem is that you don't know what program to use and what man page to read! With the apropos
command you can search those descriptions and find the right tool for the job. You can use keywords to search both program names and their descriptions.
Let's have an example. Suppose you have a compressed gzip file, and you want to uncompress it. You probably want to use a program whose description or name contains the word "gzip", and now you can useapropos
for finding such a program:
$ apropos gzip
gzip (1) - compress or expand files
zforce (1) - force a '.gz' extension on all gzip files
$
Now when you look at the output of apropos, you probably see that gzip
might be what you're looking for. Now you know the command name, and can go read its man page:$ man gzip
Let's have another example. As you know, you can list the directory contents with thels
command. But there are other commands for listing the directory contents, too! Now let's try to find out what those commands might be. The first thing that comes into your mind would probably be something like this:$ apropos directory
This command probably gives you many lines of output, because "directory" is pretty common word in the descriptions of commands, and now you have a list of commands where most of the commands have nothing to do with listing the directory contents. But withapropos
, you can use more than just one keyword:$ apropos list directory
This didn't help much, though! Now you have even longer list than before! Why? Becauseapropos
displays commands whose description has either "list"or "directory". In some situations this might be good, and exactly what you want, but not right now. Let's try more:
$ apropos "list directory"
dir (1) - list directory contents
ls (1) - list directory contents
vdir (1) - list directory contents
$
This gave you the output you wanted. Because we used double quotes here, apropos
searched for a string that says "list directory", rather than for the occurrence of either word "list" or "directory".
Although you can do very simple searches with apropos
, it's a very powerful tool and you can do advanced searches, too. For example, you can use the shell wildcards in your searches with the-w
option. For more info about apropos, go read (you guessed it) its man page.
< Whatis >
While apropos
searches for the descriptions in the man pages, whatis
displays the description. It answers the question what is. Of course you can just take a look at the man page of a program to see what is the purpose of it, but if you're only interested in knowing what the program does, you can just use the whatis
command for a quick answer:
$ whatis apropos
apropos (1) - search the manual page names and descriptions
$ whatis man
man (1) - an interface to the on-line reference manuals
man (7) - macros to format man pages
$ whatis whatis
whatis (1) - display manual page descriptions
$
Now you know where to go for help, but here I covered only a little part of theman
, apropos
and whatis
commands. If you wonder what the numbers, likewhatis (1)
, after the command names in my examples were, I suggest you read the manual page for theman
command!
- View and search Unix/Linux man pages
- UNIX mAn pAges:pty(7)
- Linux man pages
- linux帮助文件man-pages man命令详解
- The Linux man-pages project
- The Linux man-pages project
- linux/unix man用法
- man pages
- Linux c++ man pages 的安装
- Linux Deepin 浏览彩色的 man pages
- Unix:the Unix man and info
- Pam x86_64 and i686 have conflicting man pages
- --help、man和info工具的区别 Linux and Unix 命令手册
- --help、man和info工具的区别 Linux and Unix 命令手册
- 安装 man pages
- 给 man pages 着色
- cygwin 安装man pages
- op03-export man pages
- 史上最牛Myeclipse序列码
- 一起动手实现Windows服务程序(监控网站是否能访问)
- QT 中实现图片渐显
- VB 皮肤
- js判断undefined类型
- View and search Unix/Linux man pages
- Android无线管理
- altium designer 6.9 如何自定义网络!!
- Winform窗体文本框实现拖拽获得目录或文件路径(C#)
- [C++] 内存保护
- 网站设计常用技巧收集
- NotePad++ 快捷键
- jquery-easyui中创建复杂布局
- 二十个你必须知道的SEO概念