Linux terminal and command supplement, Linux terminal command supplement

Source: Internet
Author: User

Linux terminal and command supplement, Linux terminal command supplement
Whoami: print a valid user ID


Who: displays which users are logged on to the system
Who-r displays the running level
Who-H display field name


W: Show who has logged on and what are they doing


Last: the/var/log/wtmp file is displayed. The user logon history and system restart history are displayed.
-N #: displays the latest # related information

Lastb:/var/tmp/btmp, displays the user's wrong Logon Attempt
-N #: Only displays the latest # related information

Lastlog: displays the last successful logon information for each user.
-U USERNAME: displays the recent logon information of a specific user.

Basename: get the file name in a path
$0: script path and name during Script Execution

Mail:


Hostname: displays the current host name.
Echo $ HOSTNAME



Generate random number:
RANDOM: 0-32768

Random number generator:
/Dev/random: If the entropy value is null, the user process will be blocked.
/Dev/urandom: the user process is not blocked. If the entropy pool is empty, it is generated in the software mode.


Terminal type:
Console: console
Pty: Physical terminal (VGA)
Tty: virtual terminal (VGA)
Ttys: Serial Terminal
Pts/#: Pseudo Terminal

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.