grep is known as one of the Three Musketeers of the text processing, although the Three Musketeers is the least functional and the simplest, but still can not be underestimated.The full name of grep is: Global search REgular expression and Print out
grep egrep usage and its corresponding regular expressionOne, grep, Egrep commandIn this paper, the basic parameters and the usage format and methods of grep egrep fgrep command and regular expression in Linux system are mainly introduced.Definition
Multiple Command execution methods:Script composition;1.shengbang2.#3. Blank lines-lines with no content, only white space characters or tabs (tab)4. Logical JudgmentShell script Programming:1. Execute permission to invoke the script through the
grep sed awk is called the text-processing Three Musketeers, this article mainly about grep.Grep:global search Regular Expression and Print out of the lineThe global search is performed using regular expressions and the matching rows are
Regular Expressions: Regular expression, REGEXDivided into two categories:Basic Regular Expressions: BREExtended Regular expression: EREgrep family:Grep:global search REgular expression and Print out of the line. Supports the use of basic regular
A regular expression: a regular expression (or regular expression, called re) is a text pattern consisting of ordinary characters (such as characters A through Z) and special characters (called metacharacters). This pattern describes one or more
Grep Regular Expression
A regular expression is a symbolic representation used to recognize text patterns. In Linux, the main program for processing regular expressions is grep. Grep searches for the rows matching the Regular Expression and delivers
grep command and regular expressiongrep commandgrep, Egrep, FgrepGrep,sed,awk Text Processing Three MusketeersGrep:global search REgular expression and Print out of the line; finds the regular expression and displays the matching rows;Regular
A regular expression is a symbolic representation that is used to identify text patterns. The main program for Linux to process regular expressions is grep. grep searches for rows that match regular expressions and transports the results to standard
Application background: We just added a user Luffy, but we don't know what its default shell is.
Q: How do I retrieve a user's default shell?
Solution:
# Grep '^ Luffy \>'/etc/passwd | cut-D:-F7
/Bin/bashf
Through the above method, we get the
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.