Time September 2, 2019 ---- September 6
The above theory / the following command
Address: Host IP (name of each host)
protocol: host name of the service
ports: each service to edit the number of
DNS: parsing each host number, become easily identifiable IP address.
Subnet: Obtain an IP address range start
Subnet Mask: get ending range of IP addresses.
domain Name: ip address information, visit the web site.
gateway: host access external network
=================== ======================== >>
troubleshooting:
protocol: host name of the service
ports: each service to edit the number of
DNS: parsing each host number, become easily identifiable IP address.
Subnet: Obtain an IP address range start
Subnet Mask: get ending range of IP addresses.
domain Name: ip address information, visit the web site.
gateway: host access external network
=================== ======================== >>
troubleshooting:
Ping address is unobstructed
remote connection is smooth (233.5.5.5.)
Check the virtual network configuration software,
check the firewall
virtual NIC configured v4 address
SSH to port service is turned on / telent 10.0.0.200 22
view the physical machine service whether in five open
reset the virtual network editor
========================================= >>
appear in the open and edit using vi command when special circumstances (restart / others are editing). there will be a file
to use ls -a to see there. file edit the original file in the vi -r (original file in the vi . in time is editing the file)
Then save and exit delete the file..
=========================== >>
Linux system network configurations:
remote connection is smooth (233.5.5.5.)
Check the virtual network configuration software,
check the firewall
virtual NIC configured v4 address
SSH to port service is turned on / telent 10.0.0.200 22
view the physical machine service whether in five open
reset the virtual network editor
========================================= >>
appear in the open and edit using vi command when special circumstances (restart / others are editing). there will be a file
to use ls -a to see there. file edit the original file in the vi -r (original file in the vi . in time is editing the file)
Then save and exit delete the file..
=========================== >>
Linux system network configurations:
Ping check network connection address
1) modify the network card address: nmtui
2) Restart card
Method 1: systemctl restart network
Second way: /etc/init.d/network restart
mode three: ifdown + NIC card name --- stop
ifup + NIC name --- start card
ifdow card name card name && ifup
PS: Linux system configuration in order to take effect, you must restart the related services.
3) check the configuration of the network card is correct
address mask configuration: ip address show centos6: ifconfig
card information how to check: ip route Show centos6: IFCON
4) modifying the virtual NIC editor gateway
vmnet8 - nat settings - gateway settings --10.0.0.254
================= ====================================== >>
remote connection Linux operating system:
1) modify the network card address: nmtui
2) Restart card
Method 1: systemctl restart network
Second way: /etc/init.d/network restart
mode three: ifdown + NIC card name --- stop
ifup + NIC name --- start card
ifdow card name card name && ifup
PS: Linux system configuration in order to take effect, you must restart the related services.
3) check the configuration of the network card is correct
address mask configuration: ip address show centos6: ifconfig
card information how to check: ip route Show centos6: IFCON
4) modifying the virtual NIC editor gateway
vmnet8 - nat settings - gateway settings --10.0.0.254
================= ====================================== >>
remote connection Linux operating system:
1) install the remote control software connection Xshell5
2) Security Software Configuration
3) establish a remote connection:
Address: connection to the host IP
protocol: service name /// ssh
port: Specific service items number 22 ///
connection will appear in the remote the problem:
a connection is normal address the ping
B card is correct command nmtui
C restore a virtual network card configuration
D system firewall
E SSH the Telnet service is turned ///
10.0.0.200 22
============== ================================================ >>
the NAT: in this mode
the advantages: a virtual machine network card address is not easily conflict
disadvantages: inconvenient physical host access
bridge: in this mode
the advantages: a virtual machine to facilitate other physical host access
drawbacks: the network card address prone to conflict
only master mode: In this mode
Only the host / can not access the Internet to access the LAN.
==================================== =========================== >>
operating system management basics:
2) Security Software Configuration
3) establish a remote connection:
Address: connection to the host IP
protocol: service name /// ssh
port: Specific service items number 22 ///
connection will appear in the remote the problem:
a connection is normal address the ping
B card is correct command nmtui
C restore a virtual network card configuration
D system firewall
E SSH the Telnet service is turned ///
10.0.0.200 22
============== ================================================ >>
the NAT: in this mode
the advantages: a virtual machine network card address is not easily conflict
disadvantages: inconvenient physical host access
bridge: in this mode
the advantages: a virtual machine to facilitate other physical host access
drawbacks: the network card address prone to conflict
only master mode: In this mode
Only the host / can not access the Internet to access the LAN.
==================================== =========================== >>
operating system management basics:
1. System directory structure: everything from the root
absolute path: starting from the root to find information
Features: more accurate
relative path: the path to find the data information from the current
features: easier to find data
2. system command prompt:
consists of three parts : host login user name of the current directory...
3. the command syntax
command | space | parameters | space | data path information
===================== ========================================== >>
important directory systems:
absolute path: starting from the root to find information
Features: more accurate
relative path: the path to find the data information from the current
features: easier to find data
2. system command prompt:
consists of three parts : host login user name of the current directory...
3. the command syntax
command | space | parameters | space | data path information
===================== ========================================== >>
important directory systems:
/ etc / --- information or service information storage system
/ bin / --- store command files (binaries) Ordinary users can use the
/ sbin / --- store command files (binaries) root user can use
/ home / - - the user's home directory slum ordinary user's home directory
/ root / --- user's home directory Palace root user's home directory
/ opt / --- third-party software stored information
/ var / --- log information
/ mnt / - - temporary mount point
/ tmp / --- Recycle Bin
/ selinux / - save selinux configuration file information and system security related programs
/ proc / --- memory, storage processes and kernel information.
======= ================================================ >>
NIC configuration file:
/ bin / --- store command files (binaries) Ordinary users can use the
/ sbin / --- store command files (binaries) root user can use
/ home / - - the user's home directory slum ordinary user's home directory
/ root / --- user's home directory Palace root user's home directory
/ opt / --- third-party software stored information
/ var / --- log information
/ mnt / - - temporary mount point
/ tmp / --- Recycle Bin
/ selinux / - save selinux configuration file information and system security related programs
/ proc / --- memory, storage processes and kernel information.
======= ================================================ >>
NIC configuration file:
Configuration file path: / etc / sysconfig / network- scripts / ifcfg-eth0
configuration file information Description:
· 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-4e9b-b673-3b9205d05afb --- 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 local area network how many hosts can be configured IP address
· gATEWAY = 10.0.0.254 --- gateway configuration information for the host to access the Internet
· 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 restart Network will restart all network cards are
restarted card services 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 card
--- restart specify eth0 card
================================== ============================== >>
Geocoding service configuration file:
configuration file information Description:
· 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-4e9b-b673-3b9205d05afb --- 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 local area network how many hosts can be configured IP address
· gATEWAY = 10.0.0.254 --- gateway configuration information for the host to access the Internet
· 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 restart Network will restart all network cards are
restarted card services 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 card
--- restart specify eth0 card
================================== ============================== >>
Geocoding service configuration file:
Configuration file path: /etc/resolv.conf
profile information Description:
nameserver 223.5.5.5
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
NIC DNS information overwrite / sync to resolv.conf file
PS: file configuration information, configuration changes later, it will take effect immediately
======================= =================== >>
host name of the configuration file path:
profile information Description:
nameserver 223.5.5.5
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
NIC DNS information overwrite / sync to resolv.conf file
PS: file configuration information, configuration changes later, it will take effect immediately
======================= =================== >>
host name of the configuration file path:
centos7: / etc / hostname
centos6: / etc / sysconfig / Network
==================================== ============ >>
permanent adjustment: You must reboot your system configuration to take effect
a temporary adjustment: let configuration to take effect immediately (reconnection) host name of the file has not changed.
hostname oldboy66-ZNB
centos7 That can temporary and permanent modifications change
the name hostnamectl set-hostname plus you have to change
=================================== ================ >>
local parsing the configuration file:
centos6: / etc / sysconfig / Network
==================================== ============ >>
permanent adjustment: You must reboot your system configuration to take effect
a temporary adjustment: let configuration to take effect immediately (reconnection) host name of the file has not changed.
hostname oldboy66-ZNB
centos7 That can temporary and permanent modifications change
the name hostnamectl set-hostname plus you have to change
=================================== ================ >>
local parsing the configuration file:
The host name and IP address relationship
Configure file path: / etc / hosts --- use vi to view, enter the ip address written in front of the host name written at the back
============ ================================== >>
system directory is mounted operation:
Configure file path: / etc / hosts --- use vi to view, enter the ip address written in front of the host name written at the back
============ ================================== >>
system directory is mounted operation:
linux system mount concept: a storage device mounted to a door (mount point) will typically be an empty directory as a mount point of
all the hardware devices represented by file
drive equipment: / dev / cdrom
disk device:
/ dev / SDA first disks / dev / sda1 / dev / sda2
/ dev / SDB second disk
all the hardware devices represented by file
drive equipment: / dev / cdrom
disk device:
/ dev / SDA first disks / 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
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
Mount automatically store files:
Configuration file path: / etc / fstab
open follows:
the UUID = 97630c81-c2f8-4735-9fe0-4d86e9aee1cd / XFS 0 0 Defaults
the UUID = 77c7cc12-e079-42f4-8462-2d76563eb7e5 / XFS Defaults 0 0 Boot
the UUID = ec4226e8-169c -4856-b114-30d19c21d82c swap swap defaults 0 0
wherein the UUID = 97630c81-c2f8-4735-9fe0-4d86e9aee1cd hardware identification information is stored in the file information == == / dev / sda3 /
========== ================================ >>
implement the system boot files automatically run the command:
open follows:
the UUID = 97630c81-c2f8-4735-9fe0-4d86e9aee1cd / XFS 0 0 Defaults
the UUID = 77c7cc12-e079-42f4-8462-2d76563eb7e5 / XFS Defaults 0 0 Boot
the UUID = ec4226e8-169c -4856-b114-30d19c21d82c swap swap defaults 0 0
wherein the UUID = 97630c81-c2f8-4735-9fe0-4d86e9aee1cd hardware identification information is stored in the file information == == / dev / sda3 /
========== ================================ >>
implement the system boot files automatically run the command:
Configuration file path: /etc/rc.local (permission)
How to configure file to take effect:
chmod + /etc/rc.d/rc.local --- to the X-profile add execute permission
NOTE: The system script - make complex efficient and simple task becomes
================================= >>
system variables or environment variable configuration file:
How to configure file to take effect:
chmod + /etc/rc.d/rc.local --- to the X-profile add execute permission
NOTE: The system script - make complex efficient and simple task becomes
================================= >>
system variables or environment variable configuration file:
Configuration file path: / etc / profile ---- configuration variables / environment variable / alias configuration information ???
profile information Description:
Method 1:
vi / etc / Profile
last line: export PATH = $ PATH: / tmp
way two:
echo the PATH = $ Export the PATH: / tmp >> / etc / profile
PS: in an enterprise environment, add information to a configuration file, using the echo must add information >> additional information
for 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 the environment variables:
1) set a good model system variable
2) system variable names are uppercase letters
how to modify environment variables: PATH
temporary Review:
Export PATH = $ PATH: / tmp where the PATH environment variable is loaded system: PATH -> / usr / local / sbin: / usr / local / bin: / usr / sbin: / usr / bin: / root / bin
permanent changes:
modify the configuration file: / etc / profile
Run the principle procedure:
1) Run
2) to load the PATH system environment variable $ -> / usr / local / sbin: / usr / local / bin: / usr / sbin: / usr / bin: / root / bin
3) into the environment variable to specify the directory
/ usr / local / sbin
/ usr / local / bin
/ usr / bin
/ the root / bin
/ tmp
4) specified environment directory corresponding command file -> Run operation
4) the directory specified environment no response command file -> command not found / no such file or directory
what variables are: script files using variable and flexible modify the script content.
set variables: format: variable name = variable value 1 = 4 numbers can be altered
to call variables : echo $ 1
example: create a file named sh suffix in order to open and edit with vi..
[root @ oldboy66 ~] # vi test.sh
1 = 4
$ 01 name echo
echo $ 02 name
echo $ name 03
effect becomes: 1 = 4
echo $ 4 01
echo $ 4 02
echo $ 4 03
===================== ================================================== ======================================
profile information Description:
Method 1:
vi / etc / Profile
last line: export PATH = $ PATH: / tmp
way two:
echo the PATH = $ Export the PATH: / tmp >> / etc / profile
PS: in an enterprise environment, add information to a configuration file, using the echo must add information >> additional information
for 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 the environment variables:
1) set a good model system variable
2) system variable names are uppercase letters
how to modify environment variables: PATH
temporary Review:
Export PATH = $ PATH: / tmp where the PATH environment variable is loaded system: PATH -> / usr / local / sbin: / usr / local / bin: / usr / sbin: / usr / bin: / root / bin
permanent changes:
modify the configuration file: / etc / profile
Run the principle procedure:
1) Run
2) to load the PATH system environment variable $ -> / usr / local / sbin: / usr / local / bin: / usr / sbin: / usr / bin: / root / bin
3) into the environment variable to specify the directory
/ usr / local / sbin
/ usr / local / bin
/ usr / bin
/ the root / bin
/ tmp
4) specified environment directory corresponding command file -> Run operation
4) the directory specified environment no response command file -> command not found / no such file or directory
what variables are: script files using variable and flexible modify the script content.
set variables: format: variable name = variable value 1 = 4 numbers can be altered
to call variables : echo $ 1
example: create a file named sh suffix in order to open and edit with vi..
[root @ oldboy66 ~] # vi test.sh
1 = 4
$ 01 name echo
echo $ 02 name
echo $ name 03
effect becomes: 1 = 4
echo $ 4 01
echo $ 4 02
echo $ 4 03
===================== ================================================== ======================================
# System commonly used commands
1) ping --- test network connectivity
2) nmtui --- graphical interface to configure the card address information
3) telnet --- remote testing service is normally open
4) shutdown --- off the system / restart system
-r 0 --- restart the system / immediate reboot system
-h 0 --- off the system / turn off the system immediately
-C --- or cancel the operation restart relationship
-r 0 --- restart the system / immediate reboot system
-h 0 --- off the system / turn off the system immediately
-C --- or cancel the operation restart relationship
5) mkdir (make directory) --- Create a directory command
-p --- create multi-level directory
-p --- create multi-level directory
6) ls (list) --- list data display system information
-d --- check the specified directory exists
-a --- display all data (display hidden files)
-h (Human) --- information shows human readable information
-l --- display file attribute details
-d --- check the specified directory exists
-a --- display all data (display hidden files)
-h (Human) --- information shows human readable information
-l --- display file attribute details
7) cd (change directory) --- Change directory
cd / cd ~: quick return the system to the user's home directory
cd ..: quick return to the parent directory
cd ../ ..: quick return to the parent directory
cd -: to quickly return to the directory where the last
cd / cd ~: quick return the system to the user's home directory
cd ..: quick return to the parent directory
cd ../ ..: quick return to the parent directory
cd -: to quickly return to the directory where the last
8) pwd --- shows the current path location information
9) touch --- create a file
10) cat --- view the file contents
11) vi --- edit the contents of a file
I --- into the insert mode (edit file content)
R & lt --- recovery / restore
I --- into the insert mode (edit file content)
R & lt --- recovery / restore
: wq --- save and exit
: q --- exit
:! q --- Force Quit
: q --- exit
:! q --- Force Quit
12) echo --- output information to the screen
echo xx> --- file input information to a file
13) cp --- Copy Data command
-R & lt --- recursive copy data (copy directory)
-help - -
14) --- mv command to move data / rename the file name
echo xx> --- file input information to a file
13) cp --- Copy Data command
-R & lt --- recursive copy data (copy directory)
-help - -
14) --- mv command to move data / rename the file name
15) rm --- delete data command
-r --- recursive delete information
-f --- erase any information (ignore the message)
-rf --- forcibly remove directory
16) man --- help command displays help information command / show profiles help
--help
17) Mount --- disk storage device mount command
-r --- recursive delete information
-f --- erase any information (ignore the message)
-rf --- forcibly remove directory
16) man --- help command displays help information command / show profiles help
--help
17) Mount --- disk storage device mount command
18) hostname --- modify the host name / full name of the host View
19) systemctl --- Management Services operating status start / restart / stop
systemctl start / stop / restart services Name
systemctl status service names --- View service running state
20) ifdown name of the NIC (eth0) --- stop the specified service card
ifup NIC name (eth0) --- start the specified card services
ifdown eth0 ifup eth0 &&
21) hostnamectl --- modify the host name
hostnamectl the SET-hostname xxx
22) --- df view disk mounting information / content to view disk usage
-h ( human) --- information display is a human-readable information
23) blkid --- display disk identification information UUID
systemctl start / stop / restart services Name
systemctl status service names --- View service running state
20) ifdown name of the NIC (eth0) --- stop the specified service card
ifup NIC name (eth0) --- start the specified card services
ifdown eth0 ifup eth0 &&
21) hostnamectl --- modify the host name
hostnamectl the SET-hostname xxx
22) --- df view disk mounting information / content to view disk usage
-h ( human) --- information display is a human-readable information
23) blkid --- display disk identification information UUID
24) export --- used to set environment variables
25) source --- immediately loaded environment variable configuration file
/ etc / profile
/ etc / profile
The system shortcut
ctrl + c (cancel) --- abort a command operation
tab --- Lenovo to complete a command function
ctrl + l (clear) --- Clears the screen,
the arrow keys ↑ ↓ --- retrieved once input had history command
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 (shear) a continuous string of information (not separated by spaces)
ctrl + Y --- paste cut information
ctrl + u --- delete (cut) to the left of the cursor position information for all strings
ctrl + k --- remove the right (cut) at the cursor location information of all the strings
ctrl + c (cancel) --- abort a command operation
tab --- Lenovo to complete a command function
ctrl + l (clear) --- Clears the screen,
the arrow keys ↑ ↓ --- retrieved once input had history command
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 (shear) a continuous string of information (not separated by spaces)
ctrl + Y --- paste cut information
ctrl + u --- delete (cut) to the left of the cursor position information for all strings
ctrl + k --- remove the right (cut) at the cursor location information of all the strings
3. System special symbols
- represent log in the user's home directory
· represent hidden files
.. is the parent directory
- the standard output redirection symbol features: Before you add content to a file, first empty the contents of the file, and then add the new information
>> standard output redirection symbol additional features: does not delete the contents of the documents, but added new information to the file
* indicates a wildcard match any information
before && a command is executed successfully, immediately following the execution of a command
- represent log in the user's home directory
· represent hidden files
.. is the parent directory
- the standard output redirection symbol features: Before you add content to a file, first empty the contents of the file, and then add the new information
>> standard output redirection symbol additional features: does not delete the contents of the documents, but added new information to the file
* indicates a wildcard match any information
before && a command is executed successfully, immediately following the execution of a command
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:
move the cursor quickly tips
G / shift + g --- Move the cursor to quickly switch to the last line
gg --- will quickly move the cursor to the first line of the file
10gg --- will move the cursor to a specific line
$ --- will quickly move the cursor to the line line tail
0 / ^ --- cursor quickly switch to the first row to
fast moving into edit mode and the cursor:
O --- cursor on a new line below the current line, and enter the edit mode
O --- cursor on starting a new line above the current line, and enter the edit mode
I --- directly enter the editing state current cursor position
I --- to move the cursor to the beginning of a line, enter the edit mode and
A - - the cursor is switched to the line end of the line, and enter the edit state
a --- at a character position of the current cursor enters edit mode
C --- all contents emptied right cursor position, and enter the edit mode
CC --- the whole line were empty, and enter the edit mode
· Quick edit file content information
yy --- copy the specified content information
nyy --- copy multiple lines of information
information p --- paste the copied or cut
3p --- will content copied or cut and paste 3 times
dd --- deleted (shear) the information specified row
NDD --- deleted (shear) specifies more than one line
after the line where the cursor dG --- delete all content (shear )
R & lt --- replace the specified character position information of the cursor
R & lt --- into the replacement mode, a plurality of character information can replace
the bottom row function instruction
: set nu --- display file line number information
: set nonu --- cancel the display line number information file
: s / oldboy / oldgirl / - - information on the location of the replacement cursor
: All contents of the specified% s / oldboy / oldgirl / --- replace file
: 7,12s / oldboy / oldgirl / --- replace the specified lines of information make modifications
: 6, $ s / oldboy / oldgirl / --- to the last row of the specified content specified replacement
: 6, $ s / oldboy / oldgirl / g --- line will retrieve all the information do match replacement
: 6, $ s / oldboy / oldgirl / --- the first row retrieved information to make a matching replacement
PS: when using the alternative instruction, divided symbols may be used /// ### @@@
information / search file retrieval --- filter specification information
n represents a matching information retrieval
N represents a return to the matching information
/ search information \ C --- ignore case when the file retrieval information
Special operating skills
u - undo --- vi editing undo
ctrl + r - redo --- vi editor cancel undo
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:
move the cursor quickly tips
G / shift + g --- Move the cursor to quickly switch to the last line
gg --- will quickly move the cursor to the first line of the file
10gg --- will move the cursor to a specific line
$ --- will quickly move the cursor to the line line tail
0 / ^ --- cursor quickly switch to the first row to
fast moving into edit mode and the cursor:
O --- cursor on a new line below the current line, and enter the edit mode
O --- cursor on starting a new line above the current line, and enter the edit mode
I --- directly enter the editing state current cursor position
I --- to move the cursor to the beginning of a line, enter the edit mode and
A - - the cursor is switched to the line end of the line, and enter the edit state
a --- at a character position of the current cursor enters edit mode
C --- all contents emptied right cursor position, and enter the edit mode
CC --- the whole line were empty, and enter the edit mode
· Quick edit file content information
yy --- copy the specified content information
nyy --- copy multiple lines of information
information p --- paste the copied or cut
3p --- will content copied or cut and paste 3 times
dd --- deleted (shear) the information specified row
NDD --- deleted (shear) specifies more than one line
after the line where the cursor dG --- delete all content (shear )
R & lt --- replace the specified character position information of the cursor
R & lt --- into the replacement mode, a plurality of character information can replace
the bottom row function instruction
: set nu --- display file line number information
: set nonu --- cancel the display line number information file
: s / oldboy / oldgirl / - - information on the location of the replacement cursor
: All contents of the specified% s / oldboy / oldgirl / --- replace file
: 7,12s / oldboy / oldgirl / --- replace the specified lines of information make modifications
: 6, $ s / oldboy / oldgirl / --- to the last row of the specified content specified replacement
: 6, $ s / oldboy / oldgirl / g --- line will retrieve all the information do match replacement
: 6, $ s / oldboy / oldgirl / --- the first row retrieved information to make a matching replacement
PS: when using the alternative instruction, divided symbols may be used /// ### @@@
information / search file retrieval --- filter specification information
n represents a matching information retrieval
N represents a return to the matching information
/ search information \ C --- ignore case when the file retrieval information
Special operating skills
u - undo --- vi editing undo
ctrl + r - redo --- vi editor cancel undo