当前位置: 技术问答>linux和unix
grep 命令用法
来源: 互联网 发布时间:2016-07-28
本文导语: 我自创文件abc内容为 abcdef aaabbcc TTTTTTQQQQ PPPTTTQQQ FFFEEETTT CTTTTTTTC DTHHHHHHHHHDT 123 而我用grep "^[a-z]" abc返回为 abcdef aaabbcc TTTTTTQQQQ PPPTTTQQQ FFFEEETTT CTTTTTTTC DTHHHHHHHHHDT 而用 grep "^[A-Z]" abc 返回为 TTTTTTQQQQ PPPTTTQQQ FFFEEETTT C...
我自创文件abc内容为
abcdef
aaabbcc
TTTTTTQQQQ
PPPTTTQQQ
FFFEEETTT
CTTTTTTTC
DTHHHHHHHHHDT
123
而我用grep "^[a-z]" abc返回为
abcdef
aaabbcc
TTTTTTQQQQ
PPPTTTQQQ
FFFEEETTT
CTTTTTTTC
DTHHHHHHHHHDT
而用 grep "^[A-Z]" abc 返回为
TTTTTTQQQQ
PPPTTTQQQ
FFFEEETTT
CTTTTTTTC
DTHHHHHHHHHDT
为什么grep "^[a-z]" abc 把以大写开头的东东都返回来了
如果我查询结果只要
abcdef
aaabbcc
命令又该怎么写呢,谢谢!!!
abcdef
aaabbcc
TTTTTTQQQQ
PPPTTTQQQ
FFFEEETTT
CTTTTTTTC
DTHHHHHHHHHDT
123
而我用grep "^[a-z]" abc返回为
abcdef
aaabbcc
TTTTTTQQQQ
PPPTTTQQQ
FFFEEETTT
CTTTTTTTC
DTHHHHHHHHHDT
而用 grep "^[A-Z]" abc 返回为
TTTTTTQQQQ
PPPTTTQQQ
FFFEEETTT
CTTTTTTTC
DTHHHHHHHHHDT
为什么grep "^[a-z]" abc 把以大写开头的东东都返回来了
如果我查询结果只要
abcdef
aaabbcc
命令又该怎么写呢,谢谢!!!
|
正常来说,grep "^[a-z]" abc 应该是对的