Sorry, your browser cannot access this site
This page requires browser support (enable) JavaScript
Learn more >
grep [-acinv] [--color=auto] '搜寻字符串' filename

-a :将 binary 文件以 text 文件的方式搜寻数据

-c :计算找到 ‘搜寻字符串’的次数

-i忽略大小写的不同

-n :顺便输出行号

-v :反向选择,不含搜寻字符串的

grep -i 'D'  <file2.txt | sort > result.txt 

搜索 file2.txt 中的d字母,将输出分类并写入分类文件到 result.txt

tail -f /usr/loca/apache/logs/access.log |grep -v '.jpg'

输出不含‘.jpg’的

评论