Linux Learning Note 9

Source: Internet
Author: User

Shell script commands

Diff
diff file1 File2 Compare two files in different
Rows around-C
-U output patches in a uniform format
-R Compare the differences in the directory
Patch File File.path Patching
-C Back up the original file

Grep
grep Key Character File | directory finds rows with keywords in a file or directory
-I ignores case
-n Displays the keyword in the row
-C Display the number of filter results
-V Reverse Filter
-e "keyword 1| keyword 2" filters multiple keywords
-R directory to find the files in the directory that have a key word
Note: The ^ keyword starts with a keyword
Keyword $ ends with keyword

Cut
Cut intercept characters
Cut-d delimiter Development delimiter
Cut-f 1,7 display make column
Cut-c 1-4 Displays the enactment character

Sort sorts
Sort-n Pure Digital Sorting
-U de-redundancy
|uniq-c Remove redundancy and count the number of redundancies
-T Specify delimiter
-k Specifies the column

Uniq
Sort file |uniq-c Remove redundancy and count redundant times
Number
-D Show redundant rows
-U displays unique rows

Tr ' A-Z ' A-z ' file character substitution (case)
Sed
Sed ' s/original character/replacement character/g ' file
Sed-e ' Strategy 1 '-e ' policy 2 ' file
Sed-i file to enter the converted content into the specified files
Sed ' 3,5s/original character/replace character/g ' file replace 3-5 lines
SED xd mask specified line
Sed XP replicates the specified line
Sed-n XP displays only the specified lines

Linux Learning Note 9

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.