📄 0296-0297.html
字号:
<HTML>
<HEAD>
<TITLE>Linux Complete Command Reference:User Commands:EarthWeb Inc.-</TITLE>
</HEAD>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>
-->
<!-- ISBN=0672311046 //-->
<!-- TITLE=Linux Complete Command Reference//-->
<!-- AUTHOR=Red Hat//-->
<!-- PUBLISHER=Macmillan Computer Publishing//-->
<!-- IMPRINT=Sams//-->
<!-- CHAPTER=01 //-->
<!-- PAGES=0001-0736 //-->
<!-- UNASSIGNED1 //-->
<!-- UNASSIGNED2 //-->
<P><CENTER>
<a href="0293-0295.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0298-0300.html">Next</A></CENTER></P>
<A NAME="PAGENUM-296"><P>Page 296</P></A>
<P><B>OPTIONS</B></P>
<TABLE>
<TR><TD>
-i
</TD><TD>
Log the process ID of the logger process with each line.
</TD></TR><TR><TD>
-s
</TD><TD>
Log the message to standard error, as well as the system log.
</TD></TR><TR><TD>
-f file
</TD><TD>
Log the specified file.
</TD></TR><TR><TD>
-p pri
</TD><TD>
Enter the message with the specified priority. The priority may be specified numerically or as a
facility.level pair. For example, _p local3.info logs the message(s) as informational level in the local3 facility. The default
is user.notice.
</TD></TR><TR><TD>
-t tag
</TD><TD>
Mark every line in the log with the specified tag.
</TD></TR><TR><TD>
message
</TD><TD>
Write the message to log; if not specified, and the
-f flag is not provided, standard input is logged.
</TD></TR></TABLE>
<P>The logger utility exits 0 on success, and
>0 if an error occurs.
</P>
<P><B>Example</B></P>
<P>logger system rebooted:
</P>
<!-- CODE SNIP //-->
<PRE>logger _p local0.notice _t HOSTIDM _f /dev/idmc
</PRE>
<!-- END CODE SNIP //-->
<P><B>SEE ALSO</B></P>
<!-- CODE SNIP //-->
<PRE>syslog(3), syslogd(8)
</PRE>
<!-- END CODE SNIP //-->
<P><B>Standards</B></P>
<P>The logger command is expected to be compatible with IEEE Std 1003.2 (POSIX).
</P>
<P>BSD 4.3, 6 June 1993
</P>
<H3><A NAME="ch01_ 147">
login
</A></H3>
<!-- CODE SNIP //-->
<PRE>login—Sign on
</PRE>
<!-- END CODE SNIP //-->
<P><B>SYNOPSIS</B></P>
<!-- CODE SNIP //-->
<PRE>login [ name ]
login _p
login _h hostname
login _f name
</PRE>
<!-- END CODE SNIP //-->
<P><B>DESCRIPTION</B></P>
<P>login is used when signing on to a system. It can also be used to switch
from one user to another at any time. (Most modern shells have support for this feature built into them, however.)
</P>
<P>If an argument is not given, login prompts for the username.
</P>
<P>If the user is not root, and if /etc/nologin exists, the contents of this file are printed to the screen, and the login is
terminated. This is typically used to prevent logins when the system is being taken down.
</P>
<P>If the user is root, then the login must be occurring on a
tty listed in /etc/securetty. Failures will be logged with the
syslog facility.
</P>
<P>After these conditions are checked, the password will be requested and checked (if a password is required for this
username). Ten attempts are allowed before login dies, but after the first three, the response starts to get very slow. Login failures
are reported via the syslog facility. This facility is also used to report any successful root logins.
</P>
<P>If the file .hushlogin exists, then a quiet login is performed (this disables the checking of the checking of mail and
the printing of the last login time and message of the day). Otherwise, if
/var/log/lastlog exists, the last login time is
printed (and the current login is recorded).
</P>
<A NAME="PAGENUM-297"><P>Page 297</P></A>
<P>Random administrative things, such as setting the UID and GID of the
tty, are performed. The TERM ENVIRONMENT variable
is preserved, if it exists; other ENVIRONMENT variables are preserved if the
_p option is used. Then the HOME, PATH, SHELL,
TERM, MAIL, and LOGNAME ENVIRONMENT variables are set.
PATH defaults to /usr/local/bin:/bin:/usr/bin:. for normal users, and to
/sbin:/bin:/usr/sbin:/usr/bin for root. Last, if this is not a quiet login, the message of the day is printed and the file with
the user's name in /usr/spool/mail will be checked, and a message printed if it has nonzero length.
</P>
<P>The user's shell is then started. If no shell is specified for the user in
/etc/passwd, then /bin/sh is used. If there is no
directory specified in /etc/passwd, then / is used. (The home directory is checked for the
.hushlogin file described earlier.)
</P>
<P><B>OPTIONS</B></P>
<TABLE>
<TR><TD>
_p
</TD><TD>
Used by getty(8) to tell login not to destroy the ENVIRONMENT.
</TD></TR><TR><TD>
_f
</TD><TD>
Used to skip a second login authentication. This specifically does not work for root, and does not appear to
work well under Linux.
</TD></TR><TR><TD>
_h
</TD><TD>
Used by other servers (such as telnetd(8)) to pass the name of the remote host to login so that it may be placed
in utmp and wtmp. Only the superuser may use this option.
</TD></TR></TABLE>
<P><B>FILES</B></P>
<!-- CODE //-->
<PRE>/var/run/utmp
/var/log/wtmp
/var/log/lastlog
/usr/spool/mail/*
/etc/motd
/etc/passwd
/etc/nologin
/etc/usertty
.hushlogin
</PRE>
<!-- END CODE //-->
<P><B>SEE ALSO</B></P>
<!-- CODE SNIP //-->
<PRE>init(8), getty(8), mail(1), passwd(1), passwd(5),
environ(7), shutdown(8)
</PRE>
<!-- END CODE SNIP //-->
<P><B>BUGS</B></P>
<P>Linux, unlike other Draconian operating systems, does not check quotas.
</P>
<P>The undocumented BSD _r option is not supported. This may be required by some
rlogind(8) programs.
</P>
<P><B>AUTHOR</B></P>
<P>Derived from BSD login 5.40 (May 9, 1989) by Michael Glad
(glad@daimi.dk) for HP-UX Ported to Linux 0.12:
Peter Orbaek (poe@daimi.aau.dk).
</P>
<P>Linux 0.99, 1 February 1993
</P>
<H3><A NAME="ch01_ 148">
look
</A></H3>
<P>look—Display lines beginning with a given string
</P>
<P><B>SYNOPSIS</B></P>
<!-- CODE SNIP //-->
<PRE>look [_dfa] [_t termchar] string [file]
</PRE>
<!-- END CODE SNIP //-->
<P><B>DESCRIPTION</B></P>
<P>The look utility displays any lines in file that contain
string as a prefix. As look performs a binary search, the lines in
file must be sorted.
</P>
<P><CENTER>
<a href="0293-0295.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0298-0300.html">Next</A></CENTER></P>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -