Shell Primer-Special Symbols

Source: Internet
Author: User

Special Symbols: *

Description: Wildcard character, multiple characters. All files with the suffix ". txt" are listed to

[[email protected] 111]# ls *.txt
11.txt 1.txt 22.txt 2.txt 33.txt 3.txt

Special symbols:?

Description: Wildcard characters, one character.

[email protected] 111]# ls?. Txt
1.txt 2.txt 3.txt

Special Symbols: #

Description: #后的失效, for comment description

[[email protected] 111]# ls 1.txt 2.txt
1.txt 2.txt
[[email protected] 111]# #ls 1.txt 2.txt
[[email protected] 111]# ls 1.txt #2. txt
1.txt

Special symbols: \

Note: the "#2. txt" is used as the file name for the ideographic symbol.

[[email protected] 111]# ls 1.txt \ #2. txt
LS: Unable to access #2.txt: No file or directory
1.txt

Special Symbols: |

Description: Pipe character, throw the previous result to the back processing

[email protected] 111]# cat 1.txt |wc-l
1

Special symbol: $;! $ ;

Description: The prefix of the variable; the last used variable value; end of line

[Email protected] 111]# a=1
[Email protected] 111]# echo $a
1
[[email protected] 111]# ls!$
LS $a
1.txt

Special symbols:;

Description: Used in the middle of two commands

[email protected] 111]# ls 1.txt; LS 2.txt
1.txt
2.txt

Special command: ~

Description: User's home directory symbol

[Email protected] 111]# CD ~
[Email protected] ~]# pwd
/root

Special Symbol:&

Description: Run in the background,

[Email protected] ~]# & Sleep
[1] 1314
[[email protected] ~]# jobs
[1]+ Running Sleep &

Special Symbol:>;>>;2>;2>>;<

Description: http://www.cnblogs.com/wangshaojun/p/4964498.html

Special symbols: []

Description: [0-9] Represents a number of 0-9.

[[email protected] ~]# ls [12].txt
1.txt 2.txt

[[email protected] ~]# ls [0-9a-za-z].txt
1.txt 2.txt c.txt D.txt

////////////////////////////////////////////////////////////////////////////////////////

Summary: *//?   //# //  \    //  |  //  $   /    ; &//~//[]//>;>>;<;2>;2>>

Shell Primer-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.