大宇私人领地伊甸园丨宁愿做了后悔,也不要错过后悔[www.mrdayu.com]
注册

24小时联系邮箱:[email protected]

所有文章
大宇私人伊甸园: 首页 > 所有文章 > 编程人生 > 系统架构 > Linux > Linux命令详解 > [Shell]man

[Shell]man

发布时间:2018/01/04 Linux命令详解 所有文章 标签Linuxmanshell阅读:417

Linux中man参数的使用区别:

1、Standard commands (标准命令)
2、System calls (系统调用)
3、Library functions (库函数)
4、Special devices (设备说明)
5、File formats (文件格式)
6、Games and toys (游戏和娱乐)
7、Miscellaneous (杂项)
8、Administrative Commands (管理员命令)
9 其他(Linux特定的), 用来存放内核例行程序的文档。

例如:

man 2 open

OPEN(2)                                 Linux Programmer's Manual                                OPEN(2)

NAME
       open, creat - open and possibly create a file or device

SYNOPSIS
       #include <sys/types.h>
       #include <sys/stat.h>
       #include <fcntl.h>

       int open(const char *pathname, int flags);
       int open(const char *pathname, int flags, mode_t mode);

       int creat(const char *pathname, mode_t mode);

DESCRIPTION
       Given  a  pathname for a file, open() returns a file descriptor, a small, nonnegative integer for
       use in subsequent system calls (read(2), write(2), lseek(2), fcntl(2), etc.).  The file  descrip‐
       tor  returned by a successful call will be the lowest-numbered file descriptor not currently open
       for the process.

       By default, the new file descriptor is  set  to  remain  open  across  an  execve(2)  (i.e.,  the
       FD_CLOEXEC  file descriptor flag described in fcntl(2) is initially disabled; the O_CLOEXEC flag,
       described below, can be used to change this default).  The file offset is set to the beginning of
       the file (see lseek(2)).

       A  call  to open() creates a new open file description, an entry in the system-wide table of open
       files.  This entry records the file offset and the file status flags (modifiable via the fcntl(2)
       F_SETFL  operation).  A file descriptor is a reference to one of these entries; this reference is
       unaffected if pathname is subsequently removed or modified to refer to a different file.  The new
       open  file  description is initially not shared with any other process, but sharing may arise via
       fork(2).

       The argument flags must include one of the following access modes: O_RDONLY, O_WRONLY, or O_RDWR.
       These request opening the file read-only, write-only, or read/write, respectively.

 Manual page open(2) line 1 (press h for help or q to quit)
man 3 open

open(3pm)                           Perl Programmers Reference Guide                           open(3pm)

NAME
       open - perl pragma to set default PerlIO layers for input and output

SYNOPSIS
           use open IN  => ":crlf", OUT => ":bytes";
           use open OUT => ':utf8';
           use open IO  => ":encoding(iso-8859-7)";

           use open IO  => ':locale';

           use open ':encoding(utf8)';
           use open ':locale';
           use open ':encoding(iso-8859-7)';

           use open ':std';

DESCRIPTION
       Full-fledged support for I/O layers is now implemented provided Perl is configured to use PerlIO
       as its IO system (which is now the default).

       The "open" pragma serves as one of the interfaces to declare default "layers" (also known as
       "disciplines") for all I/O. Any two-argument open(), readpipe() (aka qx//) and similar operators
       found within the lexical scope of this pragma will use the declared defaults.  Even three-
       argument opens may be affected by this pragma when they don't specify IO layers in MODE.

       With the "IN" subpragma you can declare the default layers of input streams, and with the "OUT"
       subpragma you can declare the default layers of output streams.  With the "IO"  subpragma you can
       control both input and output streams simultaneously.

       If you have a legacy encoding, you can use the ":encoding(...)" tag.

       If you want to set your encoding layers based on your locale environment variables, you can use
       the ":locale" tag.  For example:

 Manual page open(3pm) line 1 (press h for help or q to quit)

 

 

The bottom line, for me, is simple.

Let’s hope it doesn’t take 500 years for a discipline of testing to becomes the standard for software developers.

From:dayu

您好!请登录

合作网站快捷登录:
点击取消回复

已有0评论

    大宇博客

    点击这里给我发消息 点击这里给我发消息 点击这里给我发消息 点击这里给我发消息