Bash的基础知识man手册
Unix Shell本文选自基于Android设备的Kali Linux渗透测试教程。
2.1man手册
man [SECTION NUMBER] MAN PAGE NAME
以上命令中,两个选项的含义如下所示:
man 1 man
Man手册页章节号是根据它们自己的规范定义的,主要分为几个部分。如下所示:
android@localhost:~$ man 4 pts
执行以上命令后,将显示如下所示的信息:
PTS(4)Linux Programmer’s ManualPTS(4)
NAME
ptmx, pts – pseudoterminal master and slave
DESCRIPTION
Thefile/dev/ptmxis a character file with major number 5 and minor
number 2, usually of mode 0666 and owner.groupofroot.root.Itis
used to create a pseudoterminal master and slave pair.
When a process opens /dev/ptmx, it gets a file descriptor for a pseu‐
doterminal master (PTM), and a pseudoterminalslave(PTS)deviceis
createdinthe/dev/pts directory.Each file descriptor obtained by
opening /dev/ptmx is an independent PTM with itsownassociatedPTS,
whose path can be found by passing the descriptor to ptsname(3).
Beforeopeningthepseudoterminalslave, you must pass the master’s
file descriptor to grantpt(3) and unlockpt(3).
Once both the pseudoterminal master and slave are open, the slave pro‐
videsprocesseswith an interface that is identical to that of a real
terminal.
……
FILES
/dev/ptmx, /dev/pts/*
NOTES
The Linux support for the above (known as UNIX 98 pseudoterminal nam‐
ing)isdoneusing the devpts file system, that should be mounted on
/dev/pts.
BeforethisUNIX98scheme,masterpseudoterminalswerecalled
/dev/ptyp0,…andslavepseudoterminals /dev/ttyp0, …and one
needed lots of preallocated device nodes.
SEE ALSO
getpt(3), grantpt(3), ptsname(3), unlockpt(3), pty(7)
COLOPHON
This page is part of release 3.44 of the Linuxman-pagesproject.A
descriptionofthe project, and information about reporting bugs, can
be found at
本文选自基于Android设备的Kali Linux渗透测试教程。
android@localhost:~$ man 5 passwd
执行以上命令后,,将输出如下所示的信息:
PASSWD(5)File Formats and ConversionsPASSWD(5)
NAME
passwd – the password file
DESCRIPTION
/etc/passwd contains one line for each user account, with seven fields
delimited by colons (“:”). These fields are:
·login name
·optional encrypted password
·numerical user ID
·numerical group ID
·user name or comment field
·user home directory
·optional user command interpreter
The encrypted password field may be blank, in which case no password is
required to authenticate as the specified login name. However, some
applications which read the /etc/passwd file may decide not to permit
any access at all if the password field is blank. If the password field
is a lower-case “x”, then the encrypted password is actually stored in
the shadow(5) file instead; there must be a corresponding line in the
/etc/shadow file, or else the user account is invalid. If the password
field is any other string, then it will be treated as an encrypted
password, as specified by crypt(3).
The comment field is used by various system utilities, such as
finger(1).
The home directory field provides the name of the initial working
directory. The login program uses this information to set the value of
the $HOME environmental variable.
The command interpreter field provides the name of the user’s command
language interpreter, or the name of the initial program to execute.
The login program uses this information to set the value of the $SHELL
environmental variable. If this field is empty, it defaults to the
value /bin/sh.
FILES
/etc/passwd
User account information.
/etc/shadow
optional encrypted password file
/etc/passwd-
Backup file for /etc/passwd.
Note that this file is used by the tools of the shadow toolsuite,
but not by all user and password management tools.
SEE ALSO
crypt(3), getent(1), getpwnam(3), login(1), passwd(1), pwck(8),
pwconv(8), pwunconv(8), shadow(5), su(1), sulogin(8).
当花儿枯萎的时候,就是它生命终结的时候,