I have encountered a summary of the shell trivia points

Source: Internet
Author: User

1) Use of shell if

Determine if a.txt exists

If [-F a.txt]

2) Execution result of the command

Assign the execution result of the command to the variable, the following two methods are the same

time=$ (date +%y%m) time= ' date + $Y%m '

3) Find out what we need.

This can be used to determine the execution result of the command, and whether the result of the selected file or command has a corresponding value

-o means that the match is just the part we care about, plus-p indicates that the following pattern is a Perl-compatible regular expression because Pcre supports 0 wide assertions

[Email protected] by-uuid]# Ifconfig | Grep-p Em1[[email protected] by-uuid]# ifconfig | Grep-o Em1[[email protected] by-uuid]# ifconfig | Grep-op EM1

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/88/9A/wKiom1f8q-uSRVCIAAAjkEGHYXk331.png "title=" Sogou 20161011170652.png "alt=" Wkiom1f8q-usrvciaaajkeghyxk331.png "/>

4) filter lines that begin with uppercase letters that end in lowercase letters

[Email protected] by-uuid]# egrep ^[a-z].*. [A-z]$ Zhang.txt

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/88/97/wKioL1f8rd-jYpfWAAAOe5AT6W0311.png "title=" Sogou 20161011171553.png "alt=" Wkiol1f8rd-jypfwaaaoe5at6w0311.png "/>


This article is from the "Court of the Odd Tree" blog, please be sure to keep this source http://zhangdl.blog.51cto.com/11050780/1860749

I have encountered a summary of the shell trivia points

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.