Linux Basic Four

Source: Internet
Author: User

Vim Editor

VI Editor's enhanced version, syntax highlighting and other extended functions

VIM three operating modes a,i,o equal key output mode

Command mode, input mode, last line mode

Switching between modes

A: Current row insertion

I: Current line insertion

O: New Line Insert

: Key last line mode

————————————————————————————————————

Command mode:

Operation type Key Instruction purpose

Cursor in line jump Home/end jump to the beginning of the line/jump to the end

In-line jump end or $ key jumps to end of line

Full text page PgUp key page UP, PAGE Down

Cursor between lines jump gg/g jump to the first line of the file/jump to the end of the file line

————————————————————————————————————

Operation type Key Instruction purpose

Copy Yy,10yy a row at the copy cursor, 10 rows

Paste p,p after pasting at the cursor, before

Delete x or delete deletes a single character at the cursor

DD,10DD Delete a line at the cursor, 10 rows

d^ removed from the cursor to the beginning of the line

d$ Delete from cursor to end of line

————————————————————————————————————

Operation type Key Instruction purpose

Text Lookup/word to find the string "word" backwards

? Word looks forward to the string "word"

N, n jumps to the next/previous found string

Undo Edit U Undo most recent action

U undo all changes to the current line

Ctrl+r Cancel the previous undo operation

Save Exit ZZ Save file Contents and exit Vim Editor

————————————————————————————————————

Operation type Key Instruction purpose

Saving and exiting: W Save current file

: q! Force quit after you discard an existing change

: Wq/: X Save has been modified after the launch

File operations: W/root/newfile Save As other files

: r/etc/filesystrms read into other file contents

————————————————————————————————————

Action Type SET Instruction purpose

Inline substitution: S/old/new replaces the first ' old ' of the current line

: S/old/new/g replaces all ' old ' of the current line

Intra-region substitution: n,ms/old/new/g replaces all ' old ' on line n-m

:%s/old/new/g replaces all ' old ' in the file

Operation Confirmation:%S/OLD/NEW/GC Replace with C, each need user confirmation

————————————————————————————————————

Switch settings (set permanent record [email protected]/]# TOUCH/ROOT/.VIMRC)

Set instruction Purpose

: Set NU/NONU display/Do not display line numbers

: Set AI/NOAI Enable/disable auto indent

————————————————————————————————————

Disc file (Packages: where all packages are actually stored)

CD-ROM devices under Linux

Actual device files:/dev/sr0 or/DEV/HDC

Shortcut:/dev/cdrom

Mount, uninstall operation

Mount: Mount mount point (device name)

Uninstall: Umount mount point (device name)

Mount the basic operation:

[[Email protected] Desktop]# mkdir ISO

[[Email protected] Desktop]# mount/dev/cdrom/iso/

[Email protected] Desktop]# ls/iso/packages/|wc-l

To uninstall the basic operation:

[[Email protected] Desktop]# umount/iso/

View a few mount points

[[email protected] Desktop] #mount | grep sr0

Triggering the use of mount points

When you access/MISC/CD, you automatically mount the disc

[[email protected] desktop] #ls/misc/No subdirectories named CD at first

[[email protected] desktop] will automatically hang when accessed #cd/MISC/CD

[[email protected] desktop] #ls/MISC/CD see what's On the disc

[[email protected] desktop] #du-SH/MISC/CD Check disc capacity

——————————————————————————————————————————————————————

Common types of package packets

Package Type description

RPM extension. RPM for Redhat series

Deb extension. Deb for the Debian series

Source code packages typically provide a source file containing the program in A. tar.gz, tar.bz2 format of a compressed package

Other installation files, such as install.sh, Setup, *bin, *.pl, etc., green free installation, provide compiled programs and related documents

——————————————————————————————————————————————————————

RPM Package Default installation location

File type default installation location

General execution Program/usr/bin/,/bin/

Server programs, management tools/usr/sbin/,/sbin/

Configuration file/etc/,/etc/software name/

Log file/var/log/,/var/log/software name/

Program documentation, man manual page/usr/share/doc/,/usr/share/man/

————————————————————————————————————————————————————————

Querying installed Software

Querying for information about installed RPM packages

Format: rpm-q[sub-option] [software name]

Basic operation:

Rpm-qa | grep vim

Common sub-options

-A: List all packages to install

-I: View detailed information for the specified software

-L: View the file Installation checklist for the specified software

-C: Lists only the configurations in the manifest

——————————————————————————

Query which RPM package was brought by a directory file.

Format: RPM-QF [File path strength] ...

Even if the target file is deleted, you can query

——————————————————————————

Query for RPM installation files that are not installed

Format: rpm-q[sub-option] [RPM package file]

Common sub-options

-PI: View detailed information for the specified software

-PL: View the file Installation checklist for the specified software

-PC: Only the configurations in the inventory are listed

—————————————————————————

Installing the Upgrade software

Format: rpm-i RPM Package file

Rpm-u RPM Package File

Rpm-f RPM Package File

Accessibility Options

-V: Show detail information

-H: Displays the installation progress with the # sign

-force: Forced installation, overwrite installation

-test: Test installation, do not do real installation action

—————————————————————————

uninstalling RPM Software

Format: RPM-E software name

—————————————————————————

RPM Package Verification

Check. RPM package integrity, whether it is corrupted

Format: rpm-k--nosignature rpm Package file

Rpm-k--nosignature/misc/cd/packages/lynx-2.8.6-27.el6.x86_64.rpm

————————————————————————————————————

Linux Basic Four

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.