Linux cloud computing cluster Architecture Study Notes: 1-1 rhel7 basic commands, Study Notes rhel7

Source: Internet
Author: User
Tags symlink

Linux cloud computing cluster Architecture Study Notes: 1-1 rhel7 basic commands, Study Notes rhel7

1-3-RHEL7Basic commands

  • 1.1LinuxTerminal introduction Shell prompt Bash Shell basic syntax.
  • 1.2Use of basic commands: ls, pwd, and cd.
  • 1.3View the system and BIOS hardware time.
  • 1.4LinuxHow to get help, Linux shutdown command: shutdown, init, etc.
  • 1.5Linux 7Startup level, set the server to automatically start up after a call.

Word sorting:

Terminal: Terminal network-scripts network script passwd Password File

NologinDisable login shutdown reboot restart poweroff shutdown

Grep filter localhost local useradd Add User

 

GraphicalGraphics

TtyConsole terminal ()

PtsVirtual terminal ()

 Tty1-tty6

In the beginning, the graphic drawing is entered: tty1 is the graphic interface.

Graphical interface switch to character interface terminal: Ctrl + Alt + F2-6

Switch to image interface Alt + F1-F6

PtsVirtual Terminal

Pty(Virtual terminal):

If we remotelyTelnetWhen arriving at the host,Do I also need a terminal interaction?

Yes, this is the virtual terminal.Pty (pseudo-tty)

 3. pts/ptmx (pts/ptmxCombined use to achievePty ): 

Ctrl + shift + TCreate a Pseudo Terminal

Alt +Switch the number key Terminal

Alt + F4Close the terminal

UseWho am IQuery the correspondingPtsNo.

Create a new terminal and check whether the pts number is the same?

Zoom in:Ctrl + shift ++

Zoom out: ctrl +-

View the process: Verify the ssh Terminal

Experiment: Use ssh to remotely view pts

 

 

Pts (pseudo-terminal slave)Pseudo Terminal: After connecting to the terminal through ssh tools, it is displayed that the terminal is: pts

1.1.2 Shell prompt:

 [Root @ xuegod60 ~] #

[San @ xuegod60 ~] $

User name-host name-current directory-root/Common User

1.1.3 basic Bash Shell syntax

How to enter commands:

View all interpreters:

Cat/etc/shells

[Root @ xuegod60 ~] # Chsh-l

 Command Format:

Command word [Option] [parameter]

Command word: Specific command

Option: Matching condition

Parameters: The object to be processed by the command.

1.2 Basic command operation: ls command

 Purpose: view the files in the current directory.

Syntax: ls directory. If no directory is added, view the current directory.

Parameters:

-LShow shortcuts in the details system # ll = ls-l

-Show Hidden Files

-DView the directory (do not view the content)

 

Why do some directory files have different colors?

LinuxDifferent colors in the system indicate different file types.

BlueDirectory/etc

Black file/etc/passwd

Light blueLink/etc/grub2.cfg

RedCompressed package boot.tar.gz

GreenExecutable file/etc/init. d/network

Black Bottom yellow textDevice File/dev/sda

1.2.2 Pwd command

1.2.3 Cd command

Purpose: Switch Directories

Syntax: cd directory name

Cd ..Return to the parent directory

1.3 system time management: 1.3.1 view system and BIOS hardware time:

BIOSHardware time:

[Root @ xuegod60 ~] # Hwclock

View system time

[Root @ xuegod60 ~] # Date

1.3.2 modification time

1.4.1 parameter-h or-help

[Root @ xuegod60 ~] # Date -- help

[Root @ xuegod60 ~] # Fdisk-h

[Root @ localhost ~] # Man find

 HelpView Internal Command help information

-- HelpView external command help information

1.4.2Shutdown command

Shutdown, Init, reboot poweroff

Shutdown

Function: shutdown, restart, and Timed Shutdown

Syntax: shutdown [Option]

-R => restart the computer.

-H => Shutdown

-H + time => Timed Shutdown

[Root @ xuegod60 ~] # Shutdown-h + 10

10Shutdown in minutes

[Root @ xuegod60 ~] # Shutdown-h 23:30

Shutdown at a specific time point

[Root @ xuegod60 ~] # Shutdown-h now

Shut down now

Shutdown-r nowRestart now
Shutdown-r + 10 #10
Restart in minutes
Shutdown-r 22
: 22 # restart after

 

InitCommand

 

Purpose: Switch the system running level

Syntax: init 0-6

Linux 7Startup level:

0System downtime ModeThe default running level cannot be set to 0. Otherwise, the system cannot start normally and the machine is disabled.
1. single-user mode, root permission, used for system maintenance, remote login prohibited, just like safe login in Windows.
2-user mode, not supported by NFS.
3. Complete Multi-User text mode with NFS. log on to the console and go to command line mode.
4. The system is not used and generally does not need to be retained. In some special cases, you can use it to do something. For example, you can switch to this mode to make some settings when the battery of your laptop is exhausted.
5. In graphical mode, log on to the graphical GUI mode and use the X Window System.
6. Restart mode. The default running level cannot be set to 6. Otherwise, the instance cannot be started normally. If you run init 6, the system restarts.

 

1.4.3 STARTUP configuration:

RHEL7No longer use the/etc/inittab file for default startup level Configuration

SystemdUse a more free target alternative than the Run-level sysvinit.

The 3rd class is replaced by multi user.tar get.

Use graphical.tar get to replace the 5th class.

Runlevel3.targetAnd runlevel5.tar get are

The symbolic links to multi user.targetand graphical.tar get.

Switch to 3rd running level

[Root @ localhost ~] # Systemctl isolate multi-user.target

Or

[Root @ localhost ~] # Systemctl isolate runlevel3.target

 Switch to 5th running level

[Root @ localhost ~] # Systemctl isolate graphical.tar get

Or

[Root @ localhost ~] # Systemctl isolate runlevel5.target

Set the default runtime sector

Set the default third startup level

[Root @ xuegod60 ~] # Systemctl set-default multi-user.target

Removed symlink/etc/systemd/system/default.tar get.

Created symlink from/etc/systemd/system/default.tar get to/usr/lib/systemd/system/multi-user.target.

 

Set the fifth startup level by default

[Root @ xuegod60 ~] # Systemctl set-default graphical.tar get

Removed symlink/etc/systemd/system/default.tar get.

Created symlink from/etc/systemd/system/default.tar get to/usr/lib/systemd/system/graphical.tar get.

View the current default startup level

[Root @ xuegod60 ~] # Systemctl get-default

Graphical.tar get

 

 

 

Practice, timed boot

BIOS

Enter bios,Generally, after the boot, the main board screen displays the "Delete" button, and some brand hosts may press F2, F1

Power Management SetupTo go to the power management settings

Press Enter to Enter this setting, select Wake Up Event Setup, and Press Enter

 

Press enter to select,Change Disabied to Enabled,Then press enter to confirm. Then, set the time point and day.

 

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.