9.1 Regular Introduction _grep (1) What is a regularRegular is a string of regular strings. Mastering a good regular is a great help for the shell. Every language has a regular, the principle is the same. The main commands are: Grep/egrep sed awk.(2) grepgrep filters The specified keyword grep[-cinvrabc] ' word ' filenamegrep-c displays the total number of lines
1.
grepBrief introduction
grep(The global Search Regular expression (RE) and print out of the line, which searches for regular expressions and prints the rows) is a powerful text search tool that uses regular expressions to search for text and print out matching rows. of Unix
grepFamily includes
grep, Egrep and Fgrep.
with a dot and a number:grep ' ^/. [0-9] ' file name 'Point character EscapesThe following match to the 192.168.1.254 of the IP address is not correct: (LCTT: Can match to the IP address, but it is also possible to match the interval symbol is not a point similar format)grep ' 192.168.1.254 '/etc/hostsAll three point characters need to be escaped:grep ' 192/.168/.1/.254 '/etc/hostsThe following example can only match the IP address: (LCTT: In fact, d
Grep-elease 2. kernel 2.txt grep-Eh (ell | kernel displays grep-E ^ (h | y) tes not developed by h.
Grep-E l \ {2, \} 2.txt grep-E h (ell | a) o test.txt grep [a-z] \ {5, \} test.txt grep
Introduction to 1.GREP commands and regular expressions(1). grep (Global search REgular expression and print out of the line), which is a powerful text-search tool in the Linux system, that searches the regular expression globally and prints out the matching rows, is based on a user-specified "pattern (pattern) "Filters the target text to show rows that are matched by the pattern;(2). A regular expression i
What is grep? grep (Global search Regular expression (RE) and print out of the line, whose full meaning is global searching for regular expressions, is printed out. is a powerful, easy-to-use text Search tool. It can match the text in the file according to the matching method, and print the whole line that matches.in Linux, the grep family has three members, res
Introduction to 1.grep grep (global search Regular expression (RE) and print out of the line, full search of regular expressions and printing of lines) is a powerful text search tool that uses regular expressions to search for text. and print out the matching lines. The grep family of Unix includes grep,
1. grep Introduction
grep (Global search Regular expression (RE) and print out of the line, a comprehensive search for 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 rows. The grep family of Unix includes grep,
Http://www.cnblogs.com/yapollo/archive/2012/06/26/2563877.html
Original address: http://blog.sina.com.cn/s/blog_476d8cf30100tmcn.html
1. grep Introduction
grep (Global search regular Expression_r (RE) and print out of the line, a comprehensive search for 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 rows.
BatPractice:1. Find all lines in the/proc/meminfo file that begin with uppercase or lowercase s, at least three implementations.[[email protected] ~]# grep-e "^ (s|s) +"/proc/meminfo[[email protected] ~]# grep "^[ss]"/proc/meminfo[Email protected] ~]# grep-i "^s"/proc/meminfo2. Displays information about Root,centos or User1 users on the current system;
. Position Qualifier650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/83/5B/wKioL1dxLeeAEl95AAAyclQ3WBY204.png "title=" Position limit symbol. png "alt=" Wkiol1dxleeael95aaayclq3wby204.png "/>6. Other special characters650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/83/5C/wKiom1dxLh2yX1m1AAA2NV4Skpo871.png "title=" Other special characters. png "alt=" Wkiom1dxlh2yx1m1aaa2nv4skpo871.png "/>grep1. RoleThe grep command in a Linux syst
, rootComparison: sed ' s#\ (root\) #\1r#g '/etc/passwd A comparison of different, better understanding of sed and grep.----------------------------------------------------------------Extensible Regular Expression: (extended regular expression)What do you mean by extension, for example:# grep-e ' (root) '/etc/passwd# grep ' \ (root\) '/etc/passwdThe above 2 comma
line that matches the regular expression.[]: A single character, such as [a], that is, a meets the requirements.[-]: range, such as [A-z], that is, a, B, C until Z all meet the requirements.。 : all the individual characters.*: There are characters, the length can be 0.
4.grep command using a simple instance
$ grep ' test ' d*
Displays the rows that contain test in all files that start with D.
Grep Introduction
Grep (Global Search Regular Expression and print out the line, 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,
There are three major text processing tools under Linux, namely Grep,sed,awk. Now to summarize the use of grep. grep (Global search Regular expression (RE) and print out of the line, fullSearch for regular expressions and print them out) is a powerful text search tool that can use regular tablesSearch for text and print out the matching lines. The
In the use of Linux, a variety of commands will make everyone very entangled, it is difficult to fully master these commands. Here we will introduce how to use the Linux grep command and some practical application operations. I believe it will be helpful for you to use the Linux grep command.
1. grep Introduction
Grep
Lists file names for file contents that conform to the specified template style
-E
Extended grep, or egrep, can be used to extend regular expressions
--color=auto
Search keywords Display color
-V
Display software version information
Case FILE:Case one:Examples of parametersNote: You test some of the searches that contain regular ex
A little touch with Linux will know that there are three very powerful text processing tools, that is grep, sed and awk, you must have heard of it.Linux Text Processing Three musketeers:grep, Egrep, Fgrep: Text Filter tool (pattern: pattern);grep: Basic regular expression, supports-e,-fEgrep: Extended regular expression, supports-g,-fFgrep: Regular expressions ar
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.