2009-04-10

grep, du, ls指定不要检查某些文件的选项

grep和du的--exclude=GLOB和ls的--hide=GLOB可以指定不要查看匹配GLOB的文件. 这些选项的功能是一样的

$ ls
test test.c tt.c
$ cat t*
int test1 test2
int test1 test2
int test1 test2
$ grep * test
test.c:int test1 test2
tt.c:int test1 test2
test:int test1 test2
$ grep * --exclude=*.c test
test:int test1 test2
$ ls
test test.c tt.c
$ ls --hide=*.c
test
$ du -a
4 ./test
4 ./test.c
4 ./tt.c
16 .
$ du --exclude=*.c -a
4 ./test
8 .
$





转载请注明出处 http://fornote.blogspot.com

没有评论:

发表评论