Getting Started with Linux and basic operations

Source: Internet
Author: User

Getting Started with Linux and basic operations


5. User Login


The user is broadly divided into two types, ordinary users and root users, the difference is: The root user is a special management account, also known as Superuser, Root has nearly complete system control, the system damage almost unlimited ability, note that: unless necessary , to not log on as root. However, the average user has a small relative privilege and a limited amount of damage to the system.

650) this.width=650; "Src=" Https://s2.51cto.com/oss/201711/19/932fa5660041d6dfdfce3a159c349df1.png-wh_500x0-wm_3 -wmp_4-s_466651996.png "title=" 1.png "alt=" 932fa5660041d6dfdfce3a159c349df1.png-wh_ "/>

Once logged in, a graphical interface is displayed, which introduces a concept, terminal.

650) this.width=650; "Src=" Https://s3.51cto.com/oss/201711/19/3ac89000deac6046c8d9838c4822f679.png-wh_500x0-wm_3 -wmp_4-s_1583208080.png "title=" 2.png "alt=" 3ac89000deac6046c8d9838c4822f679.png-wh_ "/>

Under the graphical interface, use ctrl+alt+f[1-6] to toggle the pseudo-terminal. After switching the user name and password will need to be logged in the character interface.

650) this.width=650; "Src=" Https://s1.51cto.com/oss/201711/19/2dd122a9f22f4e653416a064c387a94a.png-wh_500x0-wm_3 -wmp_4-s_93216423.png "title=" 3.png "alt=" 2dd122a9f22f4e653416a064c387a94a.png-wh_ "/>

Bo main analysis: The login interface and graphical interface are centos7.4,centos6.9 and 7.4 is not much difference, do not do a detailed introduction, PS: After the installation of a good system is the best virtual host backup or VMware snapshot function, to prevent beginners to do the experiment misoperation, causing irreversible damage.


6. Man-Machine dialogue


6.1 Shell

In general production environment, most of the use of the character interface, it means that can not operate with the mouse, how we use the keyboard input and let the computer understand our purpose, and how to help us achieve the goal? This is the use of shall.

The Shell is the user interface of the Linux system and provides an interface for users to interact with the kernel. It receives the command entered by the user and feeds it into the kernel to execute

The shell is also known as the Command interpreter for Linux (commands interpreter))

Shell is a high-level programming language


6.2 Bash Shell

The GNU Bourne-again Shell (bash) is an important part of the GNU program.

is one of the software, is currently the Linux standard shell, and SH compatible

CentOS Default Usage

Display the currently used shell

Echo $SHELL

Displays all shells used by the current system

Cat/etc/shells

650) this.width=650; "Src=" Https://s5.51cto.com/oss/201711/19/2ffd2c620b2bb894add4a286036a2cbc.png-wh_500x0-wm_3 -wmp_4-s_181186260.png "title=" 4.png "alt=" 2ffd2c620b2bb894add4a286036a2cbc.png-wh_ "/>

Can see before I knock command, there is a section of characters, this character is called prompt (prompt)

The format is [[email protected] ~]#

Prompt the last one for # is root, while the average user is $, so judging whether a person is an administrator can not pass the name, but to look at the prompt.

650) this.width=650; "Src=" Https://s2.51cto.com/oss/201711/19/2af3a3f0b399826cf083778ca9198248.png-wh_500x0-wm_3 -wmp_4-s_3035841233.png "title=" 5.png "alt=" 2af3a3f0b399826cf083778ca9198248.png-wh_ "/>

Display prompt format can be used with commands

Show prompt format [[email protected] ~] #echo $PS

You can also change the color of the prompt to your favorite color

ps1= "\[\e[1;36m\][\[email protected]\h \w]\\$\[\e[0m\]"

650) this.width=650; "Src=" Https://s3.51cto.com/oss/201711/19/de78bc84cfd1f8ec667cd737b885db55.png-wh_500x0-wm_3 -wmp_4-s_3149201585.png "title=" 6.png "alt=" De78bc84cfd1f8ec667cd737b885db55.png-wh_ "/>

6.3 Commands


6.1 Command format

COMMAND [OPTIONS ...] [ARGUMENTS ...]

Options: One or some of the features used to enable or disable commands

Short options:-C For example:-L,-H

Long options:--word For example:--all,--human-readable

Parameters: The object of the command, such as file name, user name, etc.

Attention:

Multiple options and separating between multiple parameters and commands using white space characters

Cancel and End command execution: CTRL + C, ctrl+d

Multiple commands can be used; Symbol separation

A command can be divided into multiple lines with \

Bo Master Summary: The command is the basis of all, do not know the command or the wrong command format can not let the computer to do the work. Understanding internal commands and external commands will be a better way to perform the work we need.


6.2 Date and time

Two types of clocks for Linux

System clock: Run by the Linux kernel through the CPU's operating frequency

Hardware clock: Motherboard

Related commands

Date display and set system time

Date +%s

Date-d @1509536033

Hwclock, clock: Display hardware clock

Clock-s,--hctosys with hardware clock, correct system clock

Clock-w,--SYSTOHC to calibrate the hardware clock, whichever is the system clock

Time zone:/etc/localtime

Show Calendar: Cal–y (Show year-round calendar)

650) this.width=650; "Src=" Https://s2.51cto.com/oss/201711/19/dad394a387476125ac8f18de1519844e.png-wh_500x0-wm_3 -wmp_4-s_1454427511.png "title=" 7.png "alt=" Dad394a387476125ac8f18de1519844e.png-wh_ "/>

Bo Master knife: These are basic commands, but also to practice and familiar with the command format, the command has a further understanding. More options for date can be achieved by looking at help, and the method of viewing the help is described in detail later in blog post.


6.3 Simple Commands


Shutdown: Halt, Poweroff

Restart: reboot

-F: Force, do not call shutdown

-P: Power off

Shutdown or restart: shutdown

shutdown [OPTION] ... Time [MESSAGE]

-r:reboot

-h:halt

-c:cancel

Time: To no specified, the default equivalent is +1

Now: Immediately, equivalent to +0

+m: Relative time notation, after a few minutes; for example, +3

HH:MM: Absolute time indication, specify time


User login Information View command:

WHOAMI: Displays the currently logged in active user

Who: All current logon sessions for the system

W: All current logon sessions and actions made by the system


Nano Text Editor


Screen command:

Create a new screen session

Screen–s [SESSION]

Join Screen Session

screen–x [SESSION]

Exit and close the screen session

Exit

Stripping the current screen session

Ctrl+a,d

Show all screen sessions that are already open

Screen-ls

Resume a screen session

Screen-r [SESSION]


Bo Master knife: Basic commands need to practice more knocking, multi-help, is a skilled process, command too much slowly remember, don't be impatient.





This article is from the "Linux_ Fu Lei" blog, be sure to keep this source http://fulei.blog.51cto.com/13473432/1983335

Getting Started with Linux and basic operations

Related Article

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.