男单 618

生活象筒装的卫生纸,开始的时候怎么扯都不觉得在转,后来转的越来越快。

Archive for the ‘find’ tag

用grep在子目录中指定的文件类型中查找

without comments

grep -r abcd *.py

这样的命令得不到你期待的结果,而

grep -r abcd *

这样得到的结果又太多,仍然不是你想要的。

正解是:

find . -name *.py|xargs grep asdf

注:这是一个困惑我很久的问题,今天在 这里看到 一种解决方案 。 有人在留言中给出另外一种方法

find . -iname ‘*.cc’ -exec grep -nH ‘{}’ \;

但是看上去比较复杂,我不喜欢。

Written by amao

十二月 22nd, 2009 at 12:08 上午

Posted in 软件

Tagged with ,