Compression command-vi-Understanding shell-Regular Expression

Source: Internet
Author: User

Compression command:
*. Z compress program zookeeper case;
*. Bz2 Bzip2 program zookeeper case;
*. GZ gzip program upload history case;
* The resources packaged by the. Tar program have not been deleted;
* .Tar.gz tar program packaging example, which has passed the gzip example
Compress filename compressed file plus [-D] uncompress
Gzip filename compression plus [-D] decompress zcat 123.gz to view the compressed file content
Bzip2-Z filename compression plus [-D] unzip bzcat filename.bz2 to view the compressed file content
Tar-CVF/home/123.tar/etc package without compression
Tar-xvf 123.tar unpacks
Tar-zxvf/home/123.tar.gz unzip with Gzip
Extract tar-jxvf/home/123.tar.bz2 with Bzip2
Tar-ztvf/tmp/etc.tar.gz view tar content
Cpio-covb> parts
Cpio-icduv <Restoration

Common VI usage
General mode edit mode command mode
H left a, I, R, O, A, I, R, O: W save
Enter edit mode under J: W! Force save
On K, DD deletes the current row of the cursor: Q! Do not save and exit
L right NDD Delete n rows: WQ! Save and exit
0 move to the beginning of the row YY copy the current row: E! Restore original file
$ Copy n rows to the end of the row: W filename save
H. paste P and P at the top of the screen: Set nu to set the row number.
M screen center U undo: Set Nonu cancel row number
L click [CTRL] + R at the bottom of the screen to redo the last action ZZ and save and exit.
The last line of the G file [CTRL] + Z is paused and exited: Set nohlsearch permanently disables the highlighted display
/Work downward search: SP opens two documents at the same time
? Work: Search [CTRL] + W for two documents
Move Gg to the first row of the file: nohlsearch temporarily disables highlight

Understanding Shell
Alias displays all current command aliases alias LM = "ls-Al" command aliases unalias lm cancelling command aliases
Type is similar to which
Exprot to set or display environment variables
Exprot Path = "$ path":/sbin Add/sbin path
Echo $ path: Display path
Bash entry subroutine
Name = Yang variable
Unset name cancel variable
Echo $ name: DISPLAY variable content
Myname = "$ name its me" & myname = '$ name its me' when the single quotation mark $ name loses the variable content
CIW =/etc/sysconfig/network-scripts/set the path
Env: list all environment variables
Echo $ random
Set shell settings
PS1 = '[\ U @ \ H \ W \ A # \ #] \ $' specifies the prompt character
[Root @ Linux ~] # Read [-pt] variable ----------- read the input variables on the keyboard
Parameters:
-P: the backend can be followed by a prompt character!
-T: the backend can be connected to the "seconds !』
Declare declares shell Variables
Ulimit-A displays all restrictions
Ls/tmp/Yang & Echo "exist" | echo "not exist"
This means that when ls/tmp/yang completes the row, if it is correct, Echo "exist" will be executed. If there is a problem, Echo "not exist" will be performed"
Echo $ PATH | cut-d': '-F 5 uses the separator to read the content of section 5th.
Export | cut-C 10-20 read 10th-20 bytes
Last | grep 'root'
CAT/etc/passwd | sort display
CAT/etc/passwd | WC displays "lines, words, and bytes 』
Regular Representation
[Root @ test root] # grep [-acinv] 'search for character string' filename
Parameter description:
-A: Search for data in the binary classification case by text encoding.
-C: count the number of times that the 'search for character string' is found.
-I: Ignore the difference in the size of the shard, so the size of the Shard is the same
-N
-V: indicates the reverse selection, that is, the row without the 'search character string' content!
Grep-N '123.txt search for the character ----------- search for a specific string
Grep-n't [EA] st'123.txt search for test or taste characters --------- use [] to search for a collection character
Grep-n '[^ g] oo '123.txt search for oo ----------- selected from G before [^]
Grep-n '[0-9] '123.txt search for numbers with 0-9
Grep-n '^ The '123.txt Search Start With the row ----------- start of the row search ^
Grep-n' ^ [^ A-Za-Z] '123.txt search does not start with an English letter
Grep-n' [A-Z] $ '123.txt search for rows ending with a-Z ---------- search at the end of a row $
Grep-N 'G .. d' 123.txt Search Start with G and end with D character ---------- any character.
Grep-N 'ooo * '123.txt search contains at least two oo characters --------- duplicate character *
Sed text stream editor uses script commands to process text files
AWD mode scan and processing language
NL 123.txt | sed '2, 5d 'Delete content from the second row to the fifth row
Differences between diff and files
CMP compares two files
Patch file
Format the file to be printed by PR

 

Turn: http://blog.chinaunix.net/uid-14647215-id-142220.html

Related Article

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.