shell 中grep 和 awk的使用,与svn结合

github地址

shell 中grep 和 awk的使用,与svn结合(后续进行整理和添加)

为了提高在命令行下工作效率

eg:
svn add svn st | grep ^? | awk '{print $2}' ;
svn delete svn st | grep ^! | awk '{print $2}' ;

### grep 历史

grep这个应用程序最早由肯·汤普逊写成。grep原先是ed下的一个应用程序,名称来自于g/re/p(globally search a regular expression and print,以正规表示法进行全域查找以及打印)。在ed下,输入g/re/p这个命令后,会将所有匹配先定义样式的字符串,以行为单位打印出来。
在1973年,Unix第四版中,grep首次出现在man页面中。

man 手册中对于grep命令的介绍

NAME
grep, egrep, fgrep, zgrep, zegrep, zfgrep – file pattern searcher

SYNOPSIS
grep [-abcdDEFGHhIiJLlmnOopqRSsUVvwxZ] [-A num] [-B num] [-C[num]]
[-e pattern] [-f file] [–binary-files=value] [–color[=when]]
[–colour[=when]] [–context[=num]] [–label] [–line-buffered]
[–null] [pattern] [file …]

DESCRIPTION
The grep utility searches any given input files, selecting lines that
match one or more patterns. By default, a pattern matches an input line
if the regular expression (RE) in the pattern matches the input line
without its trailing newline. An empty expression matches every line.
Each input line that matches at least one of the patterns is written to
the standard output.

 grep is used for simple patterns and basic regular expressions (BREs);
 egrep can handle extended regular expressions (EREs).  See re_format(7)
 for more information on regular expressions.  fgrep is quicker than both
 grep and egrep, but can only handle fixed patterns (i.e. it does not
 interpret regular expressions).  Patterns may consist of one or more
 lines, allowing any of the pattern lines to match a portion of the input.

 zgrep, zegrep, and zfgrep act like grep, egrep, and fgrep, respectively,
 but accept input files compressed with the compress(1) or gzip(1) com-
 pression utilities.

 The following options are available:

 -A num, --after-context=num
         Print num lines of trailing context after each match.  See also
         the -B and -C options.

 -a, --text
         Treat all files as ASCII text.  Normally grep will simply print
         ``Binary file ... matches'' if files contain binary characters.
         Use of this option forces grep to output lines matching the spec-
         ified pattern.

 -B num, --before-context=num
     
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值