Linux Basic article -19,w who whoami last Lastb lastlog basename

Source: Internet
Author: User

W who whoami last Lastb lastlog basename sleep hostname mail

################################################

W.H.O.

WhoAmI

Last: Displays the/var/log/wtmp file, showing the user login history and System restart history

Lastb:/var/log/btmp file that displays user error attempts to log on

Lastlog: Users who have never logged in


################################################

BaseName

$: Script path and name when executing script


################################################

Sleep???

Example: every 5 seconds, log root is logged in, such as log in, show that it is logged in, and exit

Sleep 5 who | grep root

################################################

Hostname??

If the host name is not James, change it to James.

If the current host name is localhost, change it to James


################################################

Generate random numbers

random:0-32768


Random number generator

/dev/random

/dev/urandom


################################################

Mail


[Email protected] ~]# Cat/etc/sysconfig/network-scripts/ifcfg-eth0 | Mail-s "How is you?" root


[[Email protected] ~]# mail

Heirloom Mail Version 12.4 7/29/08. Type? For help.

"/var/spool/mail/root": 3 messages

> 1 [email protected] Wed Jul 04:02 83/4061 "[ABRT] full crash rep"

2 root Wed Nov 10:14 19/630 "How is it?"

3 root Wed Nov 10:33 34/913 "How is it?"

&

[Email protected] ~]# Cat/etc/sysconfig/network-scripts/ifcfg-eth0 | Mail-s "How is you?" root


This article is from the "James Zhan Linux Advanced ops" blog, so be sure to keep this source http://jameszhan.blog.51cto.com/10980469/1877468

Linux Basic article -19,w who whoami last Lastb lastlog basename

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.