[root@redhat ~]# cat law
Hi, David,
I think I failed my anatomy test yeserday. I had a terrible
stomachache. I think I ategreen tom too many fried green tomatoes.
Anyway, Tom, I need your help. I'd like to make the test up
tomorrow, green tom,but don't know where to begin My studying. Do you
think you could help me? After work, about 7 PM,come to
my place and I'll treat you to pizza in return for your help. Thanks.
grep效果:
[root@redhat ~]# grep 'Tom' law
Anyway, Tom, I need your help. I'd like to make the test up
[root@redhat ~]# perl -wnl -e '/Tom/ and print;' law
Anyway, Tom, I need your help. I'd like to make the test up
grep -v 效果:
[root@redhat ~]# perl -wnl -e '/tomorrow/ or print;' law
Hi, David,
I think I failed my anatomy test yeserday. I had a terrible
stomachache. I think I ategreen tom too many fried green tomatoes.
Anyway, Tom, I need your help. I'd like to make the test up
think you could help me? After work, about 7 PM,come to
my place and I'll treat you to pizza in return for your help. Thanks.
[root@redhat ~]# grep -v 'tomorrow' law
Hi, David,
I think I failed my anatomy test yeserday. I had a terrible
stomachache. I think I ategreen tom too many fried green tomatoes.
Anyway, Tom, I need your help. I'd like to make the test up
think you could help me? After work, about 7 PM,come to
my place and I'll treat you to pizza in return for your help. Thanks.
grep -l 效果:
[root@redhat ~]# perl -wnl -e '/Tom/ and print $ARGV and close ARGV;' law greplaw
law
[root@redhat ~]# grep -l 'Tom' law greplaw
law
grep -i 效果::
perl -wnl -e '/RE/i and print;' file file2 ...
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/37724/viewspace-152579/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/37724/viewspace-152579/