Linux learning a second weekly summary

 1. Configure Remote Link network environment
    a network card address configuration information (LAN IP address / subnet mask / gateway information)
    B virtual network configuration information (virtual host needs NIC setting / Virtual Network Editor setting)
      network mode selection:
   the NAT mode:
   features: virtual host can access the Internet
   virtual NIC vmnet8 ---> local host LAN -> Internet
   local host: 192.168.21.201 --- identity father (the host)
   to each virtual host adapters, set its own IP network address children (minors)
   10.0.0.200 --- account number information
   advantages: Web Hosting NIC address is not prone to conflict
   Cons: virtual host is not easy to access by other physical host
  
   bridge mode:  
   features: virtual host can access the Internet
   virtual NIC vmnet8 - -> local host LAN -> Internet
   local host: 192.168.21.201 --- identity father (the host)
   is set as a child of the network IP address for each virtual host NIC (adult)
   192.168.21.202 --- ID
   advantages: Web Hosting easy access to a host of other physical
   disadvantages: Web Hosting NIC address prone to conflict
   teacher machine: 192. 168.21.201 student computers: 192.168.21.101
   VM: 192.168.21.200 virtual machine: 192.168.21.200 conflict
  
   only host mode: LAN hosts can only access / can not access the Internet
    2. The remote connection to the host
    1) to install the remote connection software xshell 5 (xshell 6 multi-only group 3 session label)
    2) remote software configuration process
    3) establish a remote connection process
 3. remote connection troubleshooting ideas
       1) confirm the link remote connection is smooth
       2) verify that the remote link network has to stop
       3) to confirm whether the remote host service open
    4 virtualization software tips
       1. daily use virtual host can be multi-pending operations
       2. taskbar icon inside virtualization software virtual host batch operation
       3. avoid their own operational errors can create serious problems fast

       4. Delete the virtual host selected settings to delete data from the disk

 Operating systems management basics
    directory structure 1. system: everything from the root
    absolute path to find the data: from the root to find data
    features: better precision
    C: \ oldboy01 \ oldboy02 \ oldboy03 \ oldboy.txt
    C: \ Oldboy \ oldboy01 \ oldboy02 \ oldboy03 \ oldboy04 \ oldboy.txt
    using relative path lookup data: Find data information from the current path
    characteristics: easy to find better data
    oldboy03 / oldboy.txt
    C: \ Oldboy \ oldboy01 \ oldboy02 \ oldboy03 \ oldboy04 \ return to a layer not see olddog.txt
 2. control system command prompt
    effects: prompt management personnel can enter the command
    [root @ oldboyedu ~] #
      01 02 03 
    : the three-part
    01. Log on to the user information system  
    02 the host name information system
    03. display directory information currently resides
 3. the command syntax of  
    the command parameter space space data information (path / file)
    RM -f oldboy.txt

       The conditions of marriage (rich / have a room) white Formica
       conditions of marriage (money / no room) woman on the line 

Some have a relationship and a file directory command
    1. System data backup copy ==> cp copy command
    syntax: cp parameters of the source files (requires the backup file) object files (files after backup)
       backup file information
    cp / etc / hosts / etc / hosts.bak
       cp / etc / hosts / opt /
   
    added: overwrite the file problem
    with normal replication will be prompted to overwrite the file:
    [root @ oldboyedu ~] # cp / etc / hosts / opt /
       cp: Overwrite '/ opt / hosts' ? the y-
       [root @ oldboyedu ~] # CAT / opt / hosts
       127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
       :: 1 localhost localhost.localdomain localhost6 localhost6.localdomain6
       Oldboy
       how to mandatory coverage:
    method one: \ cp oldboy01.txt / opt / --- ignore the message coverage
    Method Two: / usr / bin / cp oldboy01.txt / opt / --- ignore the message coverage
    Backup directory information
    CP -R & lt / Oldboy / / tmp /
   
 2. Operation information of the mobile data system (shear) move ==> mv   
    syntax: mv source parameter file (the file to be moved) the target path (moving path what)
       move files information:
    mv oldboy01.txt / tmp /
    mobile directory information
    mv / oldboy / / tmp /
    Rename operation:
    mv Oldboy / oldgirl /
   
 3. System Data Delete command remove == rm
    to delete the file information
    rm -f /oldboy/oldboy01.txt
   
    delete the directory information
    RM -rf / Oldboy /  
    -r recursively delete directory data
    -f forced to delete the directory data (do not have a confirmation prompt)
   
    to delete the root operation:
    RM -rf --no-preserve-root /
    RM -rf / *
   
Commonly used system shortcut:
    ctrl + A --- quickly move the cursor to the beginning
    ctrl + E --- quickly move the cursor to the end of the line
    ctrl + ← → --- cursor quickly move around in accordance with the word string 
 ctrl + W --- delete (cut) a continuous string of information (not separated by spaces)
    Ctrl + Y --- paste cut information
    ctrl + u --- deleted (shear) all strings of the cursor position from the left information
    + k --- deleted (shear) string information of all right cursor position Ctrl
    Ctrl + INSERT --- review the content selected by the cursor
    shift + insert --- paste the copied content
    on esc +. --- retrieval Finally, a command parameter information
 
vi command usage and tips
    vi command three modes:
    · 01 Command mode: first open the file for editing mode          
 · 02 Edit mode: you can modify the file information direct command mode - i - Edit mode
                                                Edit mode - esc - command mode
    · 03 line mode: enter vi edit instruction information, perform different functions command mode -: - line mode
                  ! wq qq line mode - esc - command mode
   
 vi command tips:
    fast moving cursor skills
      G / shift + g --- Move the cursor to quickly switch to the last line 
   gg --- Move the cursor quickly switch to the file of the line
 10gg --- will move the cursor to a specific line
    $ --- Move the cursor to quickly switch to a line end of the line
  0 / ^ --- cursor quickly switch to the first row to
 
 fast moving into edit mode and the cursor:
   O --- cursor starting a new line below the current line, and enter the edit mode
   O --- a a new line in the current cursor line above, and enter the edit mode
   I --- current cursor position directly enter the edit mode
   line I --- move the cursor to the first row, and enter the edit state
   A --- move the cursor to the line end of the line, and enter the edit state
   A --- in the current cursor position one character to enter edit mode
   C --- all content to the right of the cursor position empty, and enter the edit mode
   cc --- whole line will be empty, and into edit mode
  
 · Quick edit file content information
      YY --- copy contents information designated
     NYY multiple lines --- copy
      information P --- paste the copied or cut 
  3P --- content copied or cut and paste 3 times
   dd --- removed (cut) line of information specified
  NDD --- deleted (shear) specify multiple information
      everything after dG --- delete the line where the cursor (shear)
       R & lt --- replace the specified character position information of the cursor
       R & lt --- into replace mode, you can replace multiple characters information   
        
 · bottom line function instruction
      : set nu --- display file line number information
      : set nonu --- cancel the display line number information file 
      : s / oldboy / oldgirl / --- cursor location information of a replacement
      :% s / oldboy / oldgirl / --- replace all the contents of the specified file
      : 7,12s / oldboy / oldgirl / --- replace the specified lines of information make modifications 
      : 6, $ s / oldboy / oldgirl / --- last line specifies the contents of the specified line to replace
    : 6 , $ s / oldboy / oldgirl / g --- match the row retrieved all the information to do the replacement
   : 6, $ s / oldboy / oldgirl / --- the first row to retrieve information matching to make replacement 
      PS: when using the alternative instruction, divided symbols may be used /// ### @@@
   information / --- search filter retrieval designation information file 
                               n represents a matching information retrieval
                               N represents a return to the match information
   / search information \ c --- retrieve information in the file to ignore case
  
    -specific operating skills
   u - undo --- vi edit undo
      Edit Undo cancel redo --- vi - ctrl + r

  

Operating system directory mount
   linux mount system concepts: a storage device mounted to a door (mount point) will typically be an empty directory as a mount point
   all hardware devices represented by file 
   drive equipment: / dev / cdrom
   disk device: 
   / dev / sda first disk / dev / sda1 / dev / sda2
   / dev / SDB second disk
   To mount on the drive steps:
   first step: identifying confirm the drive device has
  
   a second step: Check whether there is a mounted directory
   [oldboyedu the root @ ~] LS # -d / mnt
   / mnt

   third steps of: hanging load operation of the storage device + door to build relationships
   #mount storage hardware devices (CD-ROM file information) mount point (directory information)
   Mount / dev / cdrom / mnt  
04. The system of important directories
    bin --- store command files (binaries) directory
   sbin --- super user can use the command stored in the directory
    etc --- storage system or service program profile information
   home --- save user data home directory slum ordinary user's home directory
   root --- user data stored in the home directory Palace super administrator root user's home directory
    mnt --- temporary mount point directory
 opt --- third-party storage software program to generate data
 usr / local
 data proc --- directory are stored in the memory process information and kernel file information storage
 selinux selinux --- save the configuration file information and system security procedures
 tmp --- temporarily store data directory / Recycle Bin
 var - - save the file (log file) data often change
 
Information system important files:
    / etc /
 1) network card configuration file
    configuration file path: / etc / sysconfig / network-  scripts / ifcfg-eth0
    configuration file information notes:
    · defined using the TYPE = --- Ethernet network types
    · BOOTPROTO = none --- whether to automatically obtain an IP address
                                 none / static: do not let the IP address changes * business environment
                                    dhcp: dynamic IP address         
       · nAME = eth0 --- set the card name information             
       · the DEVICE = eth0 
    · UUID = f3a6f219-0d68 b673-3b9205d05afb--4e9b
                             --- hardware identification number information
    · ONBOOT = yes --- the system will activate the card to boot
    · IPADDR = 10.0.0.200 --- configure the IP address information
    · PREFIX = 24 --- subnet mask information to determine a number of LAN hosts can configure an IP address
    · GATEWAY = 10.0.0.254 --- gateway configuration information that allows hosts to access external networks
    · DNS1 = 223.5.5.5 - - access domain name -> ip address information,
                                 visit the Web site domain name, you can also show whether the communication
    configuration file changes to restart the service:
    restart a service mode card: centos7
    systemctl Network will restart all network card restart
    to restart the service card Second way: centos7 centos6
    / etc / init.d / network restart will restart all network cards are
    restarted card services three ways: only the specified network card restart
    ifdown (interface down) eth0 --- stop eth0 network card
    ifup (interface up) eth0 --- start eth0 NIC
    ifdown eth0 && ifup eth0 --- restart specify eth0 NIC
   
 2) address resolution service profile
    configuration file path: /etc/resolv.conf
    Profile Information Description:
    nameserver 223.5.5.5
       added: common DNS server
    223.5.5.5/223.6.6.6 Ali cloud * DNS
    114.114.114.114 carriers DNS
    8.8.8.8 Google's DNS
    Network Service Restart
    card information will override DNS / sync to resolv .conf file
    PS: file configuration information, the configuration changes will take effect immediately
   
 3) host name of the configuration file
    server system host name nomenclature:
    address name - the name of the room - the room cabinet
    BJ -PBS -2012A
    SJZ
       Configuration file path:
       centos7: / etc / hostname
       centos6: / etc / sysconfig / Network 
       Permanent adjustment: You must reboot the system to take effect Configuration   
    vi / etc / hostname
    ZNB oldboy66-
    temporary adjustment: Let configuration to take effect immediately (reconnection)
    hostname oldboy66-ZNB
   
    centos7 That may temporarily modify a permanent change
    hostnamectl the SET-hostname oldboyedu.com
 
    4) Local parsing the configuration file to the host name and IP address relationship 
       configure file path: / etc / hosts 
    5) a file storage device automatically loading
       the configuration file path: / etc / fstab
       profile NOTE:   
    the UUID = 97630c81-c2f8-4735-9fe0-4d86e9aee1cd / XFS 0 0 Defaults
       the UUID = 77c7cc12-e079-42f4-8462-2d76563eb7e5 / XFS the Boot Defaults 0 0
       UUID = ec4226e8-169c-4856-b114-30d19c21d82c swap swap Defaults 0 0
                     01 02                     
      
    01. UUID: hardware identification information == information storage file
    / dev / sda1: UUID = " 77c7cc12-e079-42f4- 8462-2d76563eb7e5 "
       / dev / sda2: the UUID =" ec4226e8-169c-4856-b114-30d19c21d82c "
       / dev / sda3: the UUID =" 97630c81-c2f8-4735-9fe0-4d86e9aee1cd "
 6) implement the system boot automatically run the command file
       configuration file path: /etc/rc.local (permission to execute)
       profile information Description:
    Profile How to take effect:
    chmod + the X-/etc/rc.d/rc.local - - add execute permissions to the profile
          
    extended: the script system (special) make complex / duplication -> simple and efficient
    1) how to script: command
    2) run the script file: sh / path / script modify the script file permissions to execute permissions - / path / script
   
    demands: on each new server
    01. create three directories / Oldboy / oldboy01 / oldgirl / oldgirl01 / olddog / olddog01
    02. three files are created /oldboy/oldboy01/oldboy.txt / oldgirl / oldgirl01 / oldgirl.txt /olddog/olddog01/olddog.txt
    03. modify the host name oldboy66 both temporary and permanent modifications
   
 7) system variable or the environment variable configuration file
    configuration file path: / etc / profile --- configuration variables / environment variables / alias configuration information ???
    profile information Description:
    Method 1:
    vi / etc / profile
    The last line: export PATH = $ PATH: / tmp
    Second way:
    echo the PATH = $ Export the PATH: / tmp >> / etc / Profile
    PS: In an enterprise environment, add information to a configuration file, using the echo add information must be used >> additional information on
   
    the configuration file to take effect:
    one way: connect to the server to reproduce
    way: use command immediately loaded environment variable configuration file
            source / etc / profile
 
       What is variable: the variables used in the script file, modify the script content and flexible 
    set variables: format: variable name = variable + the y-value = 10 the X-the X-5 the y-= =?
                      name = Oldboy
    call variable: echo $ name
   
    script configuration:
    [root @ oldboy66 ~] # CAT test.sh
       name = olddog
       echo $ name 01
       echo $ 02 name
       echo $ name 03
   
    What is the environment variables:
    1) set a good model system variable
    2) system variable names are uppercase letters
   
    How to modify environment variables: PATH
    temporarily modify:
    Export the PATH = $ the PATH: / tmp
    permanent changes:
    modify the configuration file: / etc / profile
   
    execution command principle process:
    1) Run
    2) loading system environment variables $ PATH -> / usr / local / sbin: / usr / local / bin: / usr / sbin: / usr / bin: / root / bin
    3) into the environment variable specifies the directory
       / usr / local / sbin 
       / usr / local / bin
       / usr / sbin
       / usr / bin
       / the root / bin
    / tmp
    . 4) specified environment directory corresponding command file -> Run operation
    4) specified environment directory does not respond to commands File -> command not found / No such file or directory
 
 
 

 

Guess you like

Origin www.cnblogs.com/oldboy66d/p/11489373.html