ChinaUnix.net
相关文章推荐:

find xargs grep

xargs - build and execute command lines from standard input This manual page documents the GNU version of xargs. xargs reads items from the standard input, delimited by blanks (which can be protected with double or single quotes or a backslash) or newlines, and executes the command (default is /bin/echo) one or more times with any initial-arguments followed by ...

by yl2003215059 - Linux文档专区 - 2008-03-23 22:07:22 阅读(970) 回复(0)

相关讨论

--------------------------------------------------------------------------- --------------------------------------------------------------------------- 正则表达式 \分别表示单词的开始和结束 ex: \ 以T或者t开头,om结尾的单词 正则表达式的元字符集: 1) ^行首 /^love/ 以love开头的行; 2) $行尾 /love$/ 以love结尾的行; 3) . /l..e/ 匹配所有这样的行,字母l后面紧跟任意两个字符然后是e的行 4) *...

by 蜡笔pearly - Linux文档专区 - 2006-05-15 16:37:53 阅读(1391) 回复(0)

我们在一个文件夹下的所有文件中查找一个字符串“aaa”,我们可以使用下面这条组合命令 find . | xargs grep "aaa" 如果我们想要把grep匹配的结果使用颜色区分开,我们可以 find . | xargs grep --color "aaa" 但是,现在我将grep --color配置到别名文件中,再使用 find . | xargs grep "aaa" 这个命令进行查找的时候,输出的结果就不会带有颜色,很明确的一点是我的别名已经做上了,使用type查看也可以看到:grep is aliased t...

by heiheisoftware - Shell - 2012-03-21 00:07:55 阅读(6760) 回复(17)

在linux下搜索文件中的关键字,以及确定所在文件,并对find+exec、find+xargs进行效率测试 原来自己用的笨办法 cat *.c|grep 'soundcore_fops' 却没有办法知道是在哪个文件里 最简单的方法是用 grep 'soundcore_fops' *.c 或者用find find ./ -name "*.c" -print0 |xargs -i -0 grep -n "{}" 然后对find+exec、find+xargs进行效率测试 采用findutils-4.2.30 # time find /usr/include -type f -exec grep NFS_VERSION {} + /u...

by tobeabetterman - Linux文档专区 - 2007-04-12 13:39:14 阅读(1063) 回复(0)

当前需要使用find xargs的命令组合,如下: ----------------------------- find . -name "*.csv" | xargs grep 回车换行 ----------------------------- 找出当前目录下,csv文件中,所有出现回车换行的地方 请问这里应该如何表示这个回车换行呢? 另外,对于csv文件,都是UTF-8的,找起来,需要注意什么吗?

by 我是个野鸭子 - Shell - 2014-04-14 19:19:18 阅读(1914) 回复(5)

查询出的结果没有显示出字符串“service_id”都在哪个文件,怎么能把文件名显示出来

by wsryyffs - Shell - 2007-12-19 15:51:55 阅读(1676) 回复(4)

怎么在bsd下这个xargs -i就莫发用了? 我想查找某部分文件内容中是否喊有某个字符,并且打印出这些文件名 现在bsd下就不行,linux下可以。

by zhengwei_zw - Shell - 2007-03-16 23:01:22 阅读(3225) 回复(17)

grep、 sed、 findxargs、 gawk 输入输出,好用不好学的东西 2009-08-28 16:46:36  标签:   [推送到技术圈] 正则表达式 \< \>分别表示单词的开始和结束 ex: \<[Tt]om\> 以T或者t开头,om结尾的单词 正则表达式的元字符集: 1) ^行首 /^love/ 以love开头的行; 2) $行尾 /love$/ 以love结尾的行; 3) . /l..e/ 匹配所有这样的行,字母l后面紧跟任意两个字符然后是e的行 4) * 重复0次或者任意多次前面字符 5) [x-y] 字符范围...

by liyihongcug - Linux系统管理 - 2010-09-09 11:46:51 阅读(2716) 回复(4)

find /usr -mtime +100 |xargs rm 这个用法有问题么? 为什么 find /usr -mtime +100 |xargs ls 这样使用会列出所有的文件,而不受-mtime +100的限制了。 find /usr -mtime +100 |xargs file 这样就可以呢?

by cheungjustin - Shell - 2011-01-30 15:26:44 阅读(5356) 回复(11)

1 一、find 命令格式 1.1 1、find命令的一般形式为; 1.2 2、find命令的参数; 1.3 3、find命令选项 1.4 4、使用exec或ok来执行shell命令 2 二、find命令的例子 3 三、xargs 4 四、find 命令的参数 一、find 命令格式 1、find命令的一般形式为; find pathname -options [-print -exec -ok ...] 2、find命令的参数; pathname: find命令所查找的目录路径。例如用.来表示当前目录,用...

by emmoblin - Linux文档专区 - 2008-11-21 12:20:55 阅读(592) 回复(0)

一、find 命令格式 1、find命令的一般形式为: find pathname -options [-print -exec -ok ...] 2、find命令的参数; pathname: find命令所查找的目录路径。e.g.:.来表示当前目录,用/来表示系统根目录。 -print: find命令将匹配的文件输出到标准输出。 -exec: find命令对匹配的文件执行该参数所给出的shell命令。相应命令的形式为'command' { } \;,注意{ }和\之间的空格。 -ok: 和-exec的作用相同,只不过以一种更为...

by ly44770 - Linux文档专区 - 2007-04-26 09:53:28 阅读(373) 回复(0)