Linux Command First Knowledge

Source: Internet
Author: User

ALT+CTRL+F[1~6]: Switch Virtual terminal

If you want to switch to the 2nd virtual terminal, press Alt+ctrl+f2

To switch back, press ALT+CTRL+F1.

#: System Prompt for root user

$: System prompt for a normal user

Init 0: Shutting down the machine

Ordinary users can not directly shutdown, with the root user to directly shut down the computer

Exit: Exit command

Exit the normal user test back to root, then execute exit will exit the terminal

When the root user executes exit, the login will exit.

WHOAMI: List the users who are currently logged in

WHO: List which users are currently working on the system

: 0 For the graphical interface

Pts/0 is the first terminal of the graphical interface

Tty2 is the 2nd virtual terminal

Data: Displays the current time of the system

If you want to modify the time, date month of the year

Set the time to "August 4, 2018 21:37"

Note that you should keep two-bit during the month, and keep the year four

Cal: Show Monthly calendar

For the current month

If you want to see the May 1997,

Hwclock: Set time

Synchronizing hardware

[Email Protected]sch01ar ~]# hwclock-s

Synchronization system

[Email protected] ~]# hwclock-w
Clear: Clear the screen, you can also use Ctrl+l

Clear screen is just when we look at the screen is empty, actually just the content is above

SU: Switching users

Root user switch to ordinary users do not need to lose the password, the common user Switching between the need for password, ordinary users switch to the root user also want password

SU username and Su-user name can switch users, but there is a difference between them

Su just switches identities, but the shell environment is still a normal user's shell

Su-is the user and Shell environment to switch together

The PATH environment variable error is not reported if the Shell environment is switched, that is, command not found error

Su-Switches with working directory

So using Su-it would be a little better.

Useradd: Create User

Create a user with a user name of test

[Email protected] ~]# Useradd test

Now the test user does not have the password, log on the word will be a problem

Because the password is not allowed to be empty when landing

If you switch directly with the root user, you can switch to the test user with no password.

passwd: Modify User Password

Currently the test user's password is empty, you can use passwd to create a password for test user, the password is test

Although the password is less than 8 characters are invalid password, but still modified successfully

Man: Getting Help for a command

Get help for the WhoAmI command

[email protected] ~]# man WhoAmI

Press the up and down keys to turn the page view, press the Q key to exit

View Help can also be used--help

[Email protected] ~]# WhoAmI--HELP

Linux Command First Knowledge

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.