Linux wildcard characters

Source: Internet
Author: User

The study of wildcards is a bit of a sense of laying the groundwork for regular expressions ... Python has learned regular expressions before, so this blog is still very quick to learn.

Special Symbols
|#pipe character, or (regular)>#Output Redirection>>#Output Append redirection<#Input REDIRECT<<#Append input Redirection~#Current User home directory`` $()#results after the reference command is executed$#to have a. End (Regular)^#to have a. Start (Regular)*#match all characters, wildcard characters?#any one character, wildcard characters##注释&#let the program or script switch to background execution&&#and set up at the same time[]#represents a range (regular, wildcard character){}#produces a sequence (wildcard character).#hard links to the current directory..#hard links to parent directories
wildcard characters

He's the shell's built-in feature.
Wildcard characters, used DOS should be well understood, but also very common.
Wildcard, which refers to the string containing these characters "? ","*","[]",{}

Wildcard meaning ===> matching file name

symbols function
* Matches any string/text, including an empty string; * represents any character (0 or more) LS file *
? Match any one character (not in parentheses)? represents any 1 characters ls file 0
[ABCD] Match any one of the ABCD characters
[A-z] Represents the range A to Z, which indicates the meaning of the range [] matches any one of the characters in brackets ls file 0
{..} Represents a build sequence. Separated by commas, and cannot have spaces
Add
[!ABCD] or [^ABCD] denotes non, which means that any one of the characters in the parentheses does not match

a wildcard explanation

? Any one character

[ABCD] means that any one of the characters in the bracket is set.

    • {} build Sequence

    • [] used to find files (match file names)

Use {} to back up

[^ABCD]!^ means no, take counter

[] differs from {}

    • [] can only be used to find files
    • {} used to find files, or create files, generate sequences

Special Symbols
Command 1| command 2  ## #管道符号, passing the ordinary text, string, from the previous command. |xargs   ## #管道符号, convert a string to a file name by Xargs this pipe-break command
Directory structure
.   # current directory (or "any one character" regular)  : # Top level directory of current directory
REDIRECT Symbol
>   # output Redirect, will empty the original content, and then append to the file content >>  # Append output Redirect, append to the last line of the file <   # input redirect tr xargs<<  #cat to append multiple lines of text to a file

Uncategorized Special Symbols # denotes annotations

Linux will ignore him, to the Ops people to see, explain the use of.

The value of a reference variable to a variable or a command prompt for a normal user

1. Shell
$ variable: Take the contents of the variable

2. awk
$ $ number to fetch column

3. Command prompt for ordinary users

"(ESC below) The result of an anti-quote command, equivalent to $ ()

; separate multiple commands without a logical relationship, just step-by-step

1. Shell

2. Sed

' 20p;50p;100p '2050100
CD-; Su-
    • CD- # # # returns to the last working directory , returning to the previous location
    • Su- # # # Switch User, reload environment variable

~ Current user's home directory, home
[[Email protected] ~]$ CD ~ will return the current user's home directory directly

\ Escape symbol or call mask alias
.    # (the regex represents any one character)\.   # a symbol that represents only one point

! Represents a non-

Represents a mandatory
Vi/vim
VI forced Exit (: q! )

&& expressed and

Note:the && symbol executes the following command only if the command that precedes it executes successfully

single quotes, double quotes, unquoted differences

    • Single quotes: What you see is what you gain.

    • Double quotation marks: parsing special symbols, special symbols have the original special meaning

    • No quotes: More special, wildcard characters supported

Reference Blog: http://www.cnblogs.com/chensiqiqi/p/6280351.html

Linux wildcard characters

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.