在寻找某种东西时,我是否可使用灰色来忽略某些档案,这种东西相当于ore或ign。 在寻找源码时,我通常使用这样的东西。
grep -r something * | grep -v ignore_file1 | grep -v ignore_file2
即便我能为忽视这些档案而设一个包子,也是有益的。
在寻找某种东西时,我是否可使用灰色来忽略某些档案,这种东西相当于ore或ign。 在寻找源码时,我通常使用这样的东西。
grep -r something * | grep -v ignore_file1 | grep -v ignore_file2
即便我能为忽视这些档案而设一个包子,也是有益的。
http://www.un.org/Depts/DGACM/index_spanish.htm
grep perl * --exclude=try* --exclude=tk*
现行目录中的每1份档案的搜索,其中不包括从<条码>开始的文档。
您也不妨对ack进行查询,除许多其他特征外,还不搜寻像svn和.git这样的安全局名录。
find . -path ./ignore -prune -o -exec grep -r something {} ;
在你目前名录中发现的所有档案都排除了称为“敌方”的目录(或档案),然后执行指挥圈——在不公的档案中发现的每个档案中都有的东西。
扩大使用
shopt -s extglob
for file in !(file1_ignore|file2_ignore)
do
grep ..... "$file"
done
I thinks grep does not have filename filtering. To accomplish what you are trying to do, you can combine find, xargs, and grep commands. My memory is not good, so the example might not work:
find -name "foo" | xargs grep "pattern"
Find is flexible, you can use wildcards, ignore case, or use regular expressions. You may want to read manual pages for full description.
在阅读下一个职位后,表面看来灰色确实有档案过滤器。
这里使用的是微乎其微。 • 要求标准使用量:awk, sed(由于我的腹部如此大)
cat > ~/bin/grepignore #or anywhere you like in your $PATH
egrep -v "`awk 1 ORS=| .grepignore | sed -e s/|$//g ; echo`"
^D
chmod 755 ~/bin/grepignore
cat >> ./.grepignore #above set to look in cwd
ignorefile_1
...
^D
grep -r something * | grepignore
www.un.org/Depts/DGACM/index_spanish.htm 1. 拟订一个简单的更改条款:
egrep -v ignorefile_one|ignorefile_two
a. 并非有可观的效率,而是手工使用的良好条件
I m attempting to write a bash script to parse out the following log file and give me a list of CURRENT players in the room (so ignoring players that left, but including players that may have rejoined)...
How can I check the file encoding in a shell script? I need to know if a file is encoded in utf-8 or iso-8859-1. Thanks
I like to write bash shell scripts on my iPhone, put them in an app folder with an icon, plist, etc., so they execute like apps by tapping their icon on SpringBoard. This is not interactive like ...
From a programming standpoint, when you set the bash shell to use vi or emacs via set -o vi or set -o emacs What is actually going on here? I ve been reading a book where it claims the bash shell ...
I am construcing a command in bash dynamically. This works fine: COMMAND="java myclass" ${COMMAND} Now I want to dynamically construct a command that redirectes the output: LOG=">> myfile.log ...
I want perform sha1sum file1 and sha1sum file2 and perform bitwise OR operation with them using bash. Output should be printable i.e 53a23bc2e24d039 ... (160 bit) How can I do this? I know echo $(( ...
I m 试图撰写一个双面文字,处理一个文件清单,其名字在投入档案中每栏一栏储存,就像一个一样。
Is it possible to set the Screen Title using a shell script? I thought about something like sending the key commands ctrl+A shift-A Name enter I searched for about an hour on how to emulate ...