Original article address:Http://bbs.chinaunix.net/thread-1687220-1-1.html1. Introduction grep is a powerful text search tool that uses regular expressions to search for text and print matching rows. UNIX grep families include grep, egrep, and fgrep. The commands of egrep and
Grep command usage1. grep family
Grep: Global search Regular Expression (RE) and Print out the lineThe grep family includes grep, egrep, and fgrep, egrep, and fgrep.Egrep is an extensio
JQuery. grep (), jquery. grepWhat is jQuery. grep ()?
JQuery. grep () is a function used to find the array elements that meet the filtering function. The original array is not affected, and the returned value is an array.Usage:
Statement:
jQuery.grep( array, function(elementOfArray, indexInArray) [, invert ] )
Parameter introduction:
Array type: Array used to
^$
Span style= "font-family: ' The song Body '; > indicates a blank line
\
Span style= "font-family: ' The song Body '; > Indicates the first anchor of the word, appearing on the left word of the word: a string of consecutive characters that do not contain special characters
\>
Span style= "font-family: ' The song Body '; > represents the ending anchor, appearing on the right side of the word
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 expressionsRegular expressions are mainly applied to text, so it is applied in various text editor situations, and many programming languages support string manipulati
remove disk partition utilization and sort from large to smallDf|grep-o "[[:d igit:]]\+%] |sort-n2 Find the two-bit or three-digit number in the/etc/passwdCAT/ETC/PASSWD |grep-o "\b[0-9]\{2,3\}\b"3 Use this string: Welcome to magedu each character in Linux to de-order and sort, repeat the number of rows to the frontEcho ' Welcome to magedu Linux ' |grep-o ' [^[:
(1), display lines in the/proc/meminfo file that begin with size S# grep-i ' ^s '/proc/meminfo(2), display lines in the/etc/passwd file that do not end in/bin/bash#grep-V ' \/bin\/bash$ '/etc/passwd(3), display the user name of the user with the largest ID number in the/etc/passwd file and its shellMethod 1:# cat/etc/passwd|cut-d:-f3|sort-n|tail-1|xargs getent passwd|cut-d:-f1,7nfsnobody:/sbin/nologin Metho
1. grep introduction grep (Global Search Regular Expression (re) and print out the line, comprehensive search for regular expressions and print out rows) is a powerful text search tool, it can use regular expressions to search for text and print matching rows. UNIX grep families include grep,
character, such as [a], a meets the requirements.[-]: range, such as [A-z], i.e. A, B, C to Z all meet the requirements.。 : all the individual characters.*: There are characters, the length can be 0.4.grep command uses a simple instance$ grep ' test ' d*Displays all rows that contain test in a file that begins with D.$ grep ' test ' AA bb ccDisplays the line tha
], a meets the requirements.[-]: range, such as [A-z], i.e. A, B, C to Z all meet the requirements.。 : all the individual characters.*: There are characters, the length can be 0.4.grep command uses a simple instance$ grep ' test ' d*Displays all rows that contain test in a file that begins with D.$ grep ' test ' AA bb ccDisplays the line that matches test in the
character, such as [a], a meets the requirements.[-]: range, such as [A-z], i.e. A, B, C to Z all meet the requirements.。 : all the individual characters.*: There are characters, the length can be 0.4.grep command uses a simple instance$ grep ' test ' d*Displays all rows that contain test in a file that begins with D.$ grep ' test ' AA bb ccDisplays the line tha
[a], a meets the requirements.[-]: range, such as [A-z], i.e. A, B, C to Z all meet the requirements.。 : all the individual characters.*: There are characters, the length can be 0.4.grep command uses a simple instance$ grep ' test ' d*Displays all rows that contain test in a file that begins with D.$ grep ' test ' AA bb ccDisplays the line that matches test in t
default The basic regular expression;(2)egrep: Supports the use of extended regular expressions;(3)fgrep: The use of regular expressions is not supported;Second,GrepCommandfunction: Text Search tool, according to user-specified pattern(filter condition) to match the target text line by row to check, print out the qualifying line;Pattern: The filter condition written by text character and regular expression meta-character;1.Syntax Formatgrep [OPTIONS]
/oraagent. bin-- // The actual grep is used to filter and display information or oraagent. In this case, grep oraagen [t] is used to execute grep commands. In this way, the required information is displayed if the grep command does not meet the filtering condition oraagent.-- // Information.-- // For the following ques
continuous n more than the previous re characters.
[ ]
Character set combination of RE special character symbol[ABC]: means to match A or B or C[A-Z]: Represents a match a,b,c,... Z any of these 26 letters[^a-z]: Indicates that the beginning of a string can match a successful one, as long as it is not the lowercase letter A-Z[a-z$]: Indicates that the end of a string can match a successful one if it is a lowercase letter A-Z
Extended Regular expression:
meets the requirements.[-]: range, such as [A-z], i.e. A, B, C to Z all meet the requirements.。 : all the individual characters.*: There are characters, the length can be 0.4.grep command uses a simple instance$ grep ' test ' d*Displays all rows that contain test in a file that begins with D.$ grep ' test ' AA bb ccDisplays the line that matches test in the aa,b
and is different from the graphical interface of the Windows system, we in order to enter a variety of commands through the small black box (very high-end atmosphere of the grade) before entering a text, so that after entering the text is also used to command the page, search, modify and so on. Here the "find" is the grep command, in addition to this there are egrep,fgrep, these will do not repeat. , under
Grep (globalsearchregularexpression (RE) andprintouttheline, full search for regular expressions and print out rows) is a powerful text search tool that can use regular expressions to search for text, and print the matched rows. Unix grep families include grep, egrep, and fgrep. Using the
About grepgrep (Global search Regular expression (RE) and print out of the line, full search of regular expressions and print out rows) is a powerful text search tool that uses regular expressions to search for text. and print out the matching lines.(Note: This command focuses on the line, or is read by the row, search, the use of permissions is available to all users)The grep family of Unix includes grep,
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.