Shell Special Symbols

Source: Internet
Author: User
Tags create directory

First, shell special symbol Cut command
A command that intercepts a field: cut

-D: followed by delimited characters, separated by single quotation marks
-C: followed by the first few characters
-F: The next section is followed by the number of blocks
-D followed by the delimiter character, where a colon is used as the split character, and-F 1 is the first paragraph, and the space between-F and 1 is optional.
The-C can be either 1 digits n or an interval n1-n2, or multiple digits n1,n2,n3

Second, Sort_wc_uniq command
1. Sort for sorting
-N: Sorting with pure numbers
-R: Reverse Sort

2. Order: WC
The number of rows, characters, and words used to count the document, and the commonly used options are:
-L: Count rows
-M: Statistics of characters
-W: Number of statistical words

WC does not follow any options, directly with the document, it will be the number of rows, words, characters in turn output
3. Command: Uniq
To repeat a row, often used with the sort sort command. The premise of using Uniq is to sort the files first, otherwise it won't work.

-C: Count the number of repeated rows and write the number of lines in front

Iii. Tee_tr_split Order
1. Command: Tee
-A Append

followed by the file name, similar to redirect ">", but the specific gravity of a function, the file is written in the following file, while also displayed on the screen

2. Command TR
The most common is to capitalize the lowercase: tr ' [A-z] ' [A-z] '

3. Split command
Cutting documents
Common options:
-B: Divide the document by size in bytes
-L: Split document by number of rows

Four, the shell special symbol under
1, variable prefix 2, '! ' represents the last variable in the previous hit
3,; Semicolon. To run two or more commands in a row, you need to add a ";" between the commands.

4, ~ User's home directory, regular expression means match

5, & placed behind the command, will throw the command in the background

6, > Output redirect,>> append output redirect,2> error redirect,2>> error append redirect correct and error output redirect &>

7, [] brackets, one of the specified characters, [0-9],[A-ZA-Z],[ABC]

8, | | expressed or,&& expressed and

Determine if a directory exists, such as:
[-D Amolinux] | | mkdir Amolinux

(If the Amolinux directory exists, the subsequent Create directory command is not executed; if the Amolinux directory does not exist, execute the command to create the directory)

Shell Special Symbols

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.