VI Editor
Full-screen Plain text editor
1. Software development (program preparation) 2. configuration file modification and system service invocation
Mode
Command mode insert mode last line mode
A/I/O ESC shift+:: W Save: Wq Save exit
a/i/o:wq! Force save exit (Root)
: q! Do not save exit
! Forced
#vi index.php
#vim index.php
Vi->vim (enhanced version of VI)
Instance files: 1. System log files Install.log 2.PHP file
Move the cursor H J k L move to the first line GG move to the last row g:n N line number
Set line number: Set Nu Cancel line number: Set Nonu
Copy yy Nyy copy multiple lines
Paste P
Remove single character x multiple characters NX
(cut) Single-line DD multi-line NDD DG removed from cursor to last row
Undo U anti-undo Ctrl+r
Color switch (syntax highlighting)
: Syntax on open: syntax off
Configuration file (manually established). VIMRC
#vim/ROOT/.VIMRC
Set Nu
www.vim.org
Find/n look up n find
#vim Install.log
Replace
:%s/echo/print/g Full Text replacement
: 70,85s/print/echo/g Range Replacement
Note #//
: 10,30s/^/#/g Add Comment: 20,30s/^#//g uncomment
: 60,80s/^/\/\//g Add Comment: 70,80s/^\/\///g uncomment
Package Installation
Classified source package. tar.gz. tar.bz2
Advantage: Source code open Custom Installation high efficiency
Cons: Long compile time once error is difficult to resolve
Binary package (compiled package). rpm
Advantages: Quick and easy installation speed
Cons: Cannot customize dependencies
I. Binary package use (1.rpm command to manually manage 2.yum command automation)
Mount
#mount/dev/sr0/mnt/cdrom
#cd/mnt/cdrom/packages
#ls | Wc-l Number of statistics
Naming rules for packages software name-version number-number of updates. Enterprise Edition. Hardware platform. rpm
I386 i686 32-bit system
X86_64 64-bit system
Noarch Cross-platform
1) RPM command
Installing the Tree Directory
#cd/mnt/cdrom/packages
#rpm-IVH Tree-tab
#tree
#tree/
Upgrade
#rpm-UVH
Uninstall-E (--nodeps) does not check for dependencies
#rpm-E Tree
#tree (Test)
Query-Q
#rpm-Q tree query is installed
#rpm-qa | Wc-l Query Statistics installation of all binary packages
Querying package Information-QI-QIP
#rpm-QIP tree-tab query For information about packages that are not installed
#rpm-qi tree to query installed package information
Query the location of the package installation-QL-QLP
#rpm-QLP tree-tab Query the location where the packages that are not installed will be installed
#rpm-ql tree to query the location of installed packages
Which package the query command belongs to
#rpm-qf/bin/ls
2) Yum Command Automation management
#yum-y install software name installs Y Yes
#yum-y Update software name upgrade
#yum-y Remove software name Uninstall
#yum List view software that can be installed with the Yum command
Configuring the disc Yum source
1) Mount
#mount/dev/sr0/mnt/cdrom
2) Enter the Yum source configuration directory to modify the file name
#cd/etc/yum.repos.d/
#mv Centos-base.repo Centos-base.repo.bak
3) Modify the disc Yum source configuration file
#vim Centos-media.repo
baseurl=file:///mnt/cdrom/
Gpgcheck=0
Enabled=1
Test:
#yum-y Remove tree to unload tree
#tree
#yum-y Install tree
#tree
#yum List | Wc-l
Installing GCC (C language compiler)
#yum-y Install gcc
Remote Administration Tools Xshell
Remote Transfer Tool XFTP
Source Package Installation Management
Installation Step six step: httpd-2.2.29.tar.gz
1) Unzip
#tar-ZXVF httpd-2.2.29.tar.gz
2) go to unzip directory
#cd httpd-2.2.29
3) Check the Readme INSTALL
#vim README Software Introduction
#vim Install installation Instructions
4) Check the configuration generation file Configure
#./configure--prefix=/usr/local/apache2/
5) Compile Make
#make
6) Compile and install
#make Install
Test boot httpd (Apache)
#/usr/local/apache2/bin/apachectl Start | Stop
Shutting down the Linux firewall
#setup
Open Browser test: 192.168.172.251
Unloading
#/usr/local/apache2/bin/apachectl Stop shutdown Service
#rm-rf/usr/local/apache2/
#make Clean Clear Cache file
Supplemental command:
#date View system date and time
#date-S 20161222
#date-S 12:05:59
#du-SH Statistics occupy space H common Unit s statistics (summation)
#du-sh/
Job: Word file write two times class notes 1 times (Vim editor write code)
Exercise: three times
3.VI and Software Installation