1.grep
's Regular Expression Metacharacters(Which I always dismissed~)
[^] | Matches one character not in the set | '[^A–K]ove' | Matches lines not containing a character in the range A through K, followed by ove. |
\< | Beginning-of-word anchor | '\<love' | Matches lines containing a word that begins with love. |
\> | End-of-word anchor | 'love\>' | Matches lines containing a word that ends with love. |
\(..\) | Tags matched characters | '\(love\)ing' | Tags marked portion in a register to be remembered later as number 1. To reference later, use \1 to repeat the pattern. May use up to nine tags, starting with the first tag at the left-most part of the pattern. For example, the pattern love is saved in register 1 to be referenced later as \1. |
x\{m\} x\{m,\} x\{m,n\} [a] | Repetition of character x: m times, at least m times, or between m and n times | 'o\{5\}' 'o\{5,\}' 'o\{5,10\}' | Matches if line has 5 occurences of o , at least 5 occurences of o , or between 5 and 10 occurrences of o . |
EXPLANATION
Prints the line if it contains the word north. The \< is the beginning-of-word anchor, and the \> is the end-of-word anchor.
4.grep 's Options–b | Precedes each line by the block number on which it was found. This is sometimes useful in locating disk block numbers by context. |
–c | Displays a count of matching lines rather than displaying the lines that match. |
–h | Does not display filenames. |
–i | Ignores the case of letters in making comparisons (i.e., upper-- and lowercase are considered identical). |
–l | Lists only the names of files with matching lines (once), separated by newline characters. |
–n | Precedes each line by its relative line number in the file. |
–s | Works silently, that is, displays nothing except error messages. This is useful for checking the exit status. |
–v | Inverts the search to display only lines that do not match. |
–w | Searches for the expression as a word, as if surrounded by \<
and \>.
This applies to grep
only. (Not all versions of grep
support this feature; e.g., SCO UNIX does not.) |
相关推荐
UNIX Shells by Example is the world's #1 shell programming book, from the world's #1 shell programming instructor: Ellie Quigley. In UNIX Shells by Example, Fourth Edition, Quigley has thoroughly ...
Prentice Hall - Shell Programming - Unix Shells By Example (Third Edition)
UNIX.shell范例精解(第4版).pdf.高清扫描版本,注意不是光盘里的东西,资料来源于网络-大家网,版权归原所有人所有。 由于是高清扫描,整本书有80多M,上传限制,只能分成4个文件,大家下载完4个文件后就可以了。
unix shells by example第四版哦,学习shells的经典之作
UNIX_Shells_by_Example_Fourth_Edition
UNIX Shells by Example is the world's #1 shell programming book, from the world's #1 shell programming instructor: Ellie Quigley. In UNIX Shells by Example, Fourth Edition, Quigley has thoroughly ...
UNIX Shells by Example
UNIX SHELL实例编程
UNIX Shells by Example is the world’s #1 shell programming book, from the world’s #1 shell programming instructor: Ellie Quigley. In UNIX Shells by Example, Fourth Edition, Quigley has thoroughly ...
UNIX Shells by Example英文版
Prentice.Hall.PTR.UNIX.Shells.by.Example.4th.Edition.Sep.2004.eBook-DDU.rar
学习linux shell的,包含bash,korn,tcsh等
linux shells by example,初步学习编程的同仁,共同学习,进步!!
UNIX.Shells.by.Example.4th.Edition. english publish
Unix Shells by Example (Edition 4) UNIX shell范例精解(第4版)光盘 包含所有范例脚本文件
她的著作包括Perl by Example,Third Edition(Prentice Hall PTR,2001)、UNIX Shells by example和Linux Shells by Example(Prentice Hall PTR,2000)。在她的公司网站(www.ellieq.com)上还可以找到有关UNIX、Perl...
chm 格式 方便查找
她的著作包括Perl by Example,Third Edition(Prentice Hall PTR,2001)、UNIX Shells by example和Linux Shells by Example(Prentice Hall PTR,2000)。在她的公司网站(www.ellieq.com)上还可以找到有关UNIX、Perl...