Day 01 Virtual machine related configuration

Day 01 Virtual machine related configuration

One, configure the network

1. To achieve the premise of communication between two machines

  • Have ip address
  • The two IPs must be in the same network segment
    • Similar: A: 192.168.15.92
      B: 192.168.15.93
    • From a conceptual point of view: A and B must have the same network address to be called the same network segment
    • website address:
      • Ip address and subnet address are AND (the AND of any number and 1 is unchanged, and the AND of any number and 0 is 0), and the phase AND calculation is converted into binary calculation

2. Modify the ip address of the virtual machine

2.1 View ip address

ip a == ip addrBoth are fine

2.2 Modify ip address (string interface can only be set by modifying the configuration file)

ll /etc/sysconfig/network-scripts/ifcfg-* Vertical column (ll view) print all under this file (*)

vi /etc/sysconfig/network-scripts/ifcfg-ens33 ens33 is the name of the graphics card (different versions have different names) vi (specially used for modification)

image-20201119170305139

Add four

223.5.5.5 Alibaba Cloud

image-20201119170934214

Restart network

systemctl restart network

Test network

ping www.baidu.comSuccessful will respond

Two, virtual machine clone + snapshot

clone:

There is always a pure system

Snapshot:

When we have no confidence in the operation, we can take a snapshot first, if it is broken, then restore the snapshot. No need to reinstall

Three command line composition

Everything in Linux is a file, everything is a command

1. Introduction to Linux commands

1.1 The basic structure of the command

​ Command body option parameters
​ ls -l /tmp

like: ls -l /home/vertical table prints all file information under home

Equivalent toll /home/

Command body: The command program that comes with the system after the system is installed, usually stored in a dedicated directory (/bin /sbin /usr/bin /usr/sbin /usr/local/bin)

bin : ordinary user bins : super user

Most of the commands are in English abbreviations for specific functions .
such as:
list useradd ip find

Options: options
open the specific functions of the command body. There can be zero or more, which is optional.

Parameters: The operation object of the command, the most common object is "file", which must be added in most cases

1.2 Command prompt

It is the prerequisite for the execution of the command, as long as the command we enter in this case has

$

1.3 Shell supported by Linux

​ sh
​ csh
​ ksh
​ bash

1.4 Shortcut keys supported in BASH shell

1.4.1 Ctrl type

( 1) Commonly used
ctrl + c cancel to cancel the current operation
ctrl + l (lowercase letter L) clear (command)
ctrl + d exit the current user
ctrl + r search (historical command). history|grep

(2) Understand
ctrl + a 把光标移动到行首
ctrl + e 把光标移动到行尾
ctrl+ u 把光标到行首的内容删除/剪切
ctrl + y 粘贴
delete 光标所在处从前往后删除内容
ctrl + k 把光标到行尾的内容删除/剪切
ctrl + → 向右移动一个单词
ctrl + ← 向左移动一个单词
ctrl + s 锁屏
ctrl + q 解锁

1.4.2 TAB, tab character

(1) The command body completes
TAB:
For the characters entered in a command, you canOnly represents a commandWhen
TAB is double- clicked
for the leading character of the input, it will changeallThis stringbeginningThe command prints out

(2) Parameter completion (files only)
can complete the path structure and file name

1.5 How to get help

ls --help
man ls
info ls

1.6 Shut down, restart, log off

poweroff init 0 reboot init 6 ctrl+d logout

1.7 7 file types in Linux

d: directory

  • : Ordinary file
    l: Link

b: block device

c: character device
s: socket
p: pipe file

1.8 Cancel an ongoing shutdown or restart

showdown -c

1.9 Logout of logged in account

  • exit
  • logout
  • ctrl+d

hot key

^c 终止前台运行的程序
^d 退出 等价exit
^l 清屏
^a 光标移到命令行的最前端
^e 光标移到命令行的后端
^r 搜索历史命令,利用关键词
Alt+. 引用上一个命令的最后一个参数,等价于!$
1234567

Automatic completion of commands and files Note: Tab can only complete commands and files

Day

Guess you like

Origin blog.csdn.net/A1L__/article/details/109981716