Linux terminal type, Who,last

Source: Internet
Author: User

W

W.H.O.

WhoAmI

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

-N: Displays information about the last n times

lastb:/var/log/btmp file, displaying user error login attempt history

-N:

Lastlog: Displays the last successful logon information for each user

-U USERNAME: Displays recent login information for a specific user

BaseName $: Name does not show path

Mail: Send Email

Hostname: Display host name

Generating random numbers in random:0-32768

Random number generator: Entropy pool

/dev/random More secure

/dev/urandom more useful

For example: Write a script that generates 10 random numbers using random and finds the maximum and minimum values


#!/bin/bash

Max=0

Min=0

For ((i=1;i<=10;i++))

Do

Myrand= $RANDOM

If [$i-eq 1]

Then

min= $RANDOM

Fi


If [$i-le 9]

Then

Echo-n "$myrand,"

Else

Echo $myrand

Fi


If [$myrand-gt $MAX]

Then

max= $myrand

Fi


If [$myrand-lt $MIN]

Then

min= $myrand

Fi

Done

echo "The max number is $MAX"

echo "The min number is $MIN"



Terminal type

Console: Consoles

Pty: Physical Terminal (VGA)

TTY: Virtual terminal (VGA)

TTYs: Serial Terminal

pts/#: Pseudo Terminal

This article is from the "ngames" blog, make sure to keep this source http://ngames.blog.51cto.com/3187187/1546532

Linux terminal type, Who,last

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.