24th Lesson Shell's special symbols and Cut_sort_wc_uniq_tee_tr_split commands

Source: Internet
Author: User

First, special symbols

' * ' wildcard character, any of any characters
'? ' any one character
' # ' comment characters
' \ ' de-semantic characters
' | ' piping
The prefix of the ' $ ' variable
'!$ ' combination, regular inside means end
'; ' multiple commands written to one, separated by semicolons
'? ' User's home directory, followed by a regular expression representing a match
' & ' puts the command behind the command and throws it backstage.
' > ' correct redirection
' >> ' append redirect
' 2> ' ERROR redirection
' 2>> ' ERROR chasing redirect
' &> ' redirects the error with the correct redirect in the same file
' [] ' one of the specified characters, [0-9] [A-z]
' | | ' In the shell is the meaning. If the first command executes successfully, the subsequent command will not execute
' && ' If the previous command executes successfully, the following command will be executed

Ii. several commands related to pipe breaks CutCommand: Intercepts a string,

Example: cat/etc/passwd |head-2 |cut-d ":"-f (1-10)
-d Specifies the delimiter:
-F Paragraph
-c Specifies the number of character examples: cat/etc/passwd |head-2 |cat-c 4

SortCommands: Sorting

Example: SORT-NR filename
-N is numerically arranged, and the letter is considered to be 0.
-R Reverse Order
-T delimiter

WC-l Command: Count rows

Wc-m Command: Count characters
WC-W Statistical terms
(cat-a filename can see all characters that contain hidden text)

UniqTo repeat the command:

(Sort command with uniq command to use, only convenient)
-C Count Repeats

TeeRedirection is also displayed on the screen

Similar to >,
Example: Sort 1.txt |uniq-c |tee a.txt

TRReplace character

Tr ' a ' B ', Case replacement: TR ' [A-z] ' [A-z] '
Example: Converting a string to uppercase
echo "Haohaoxuexi" |tr ' [ha] ' [ha] '

SplitCutting

-B Size (default unit), example: split-b 100M filename Custom prefix name
-L number of rows: split-l

24th Lesson Shell's special symbols and Cut_sort_wc_uniq_tee_tr_split commands

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.