一个有意思的事情(昨天看到的),grep的这个命令从哪里来的呢?
Its name comes from the ed command g/re/p
(global / regular expression search / and print), which has the same effect.
//
egrep 'openTime:\d*ms' chat_timeout.xkx
// Prints only the matching part of the lines.
egrep -o 'openTime:\d*ms' chat_timeout.xkx
// Only a count of selected lines is written to standard output
egrep -o -c 'openTime:\d*ms' chat_timeout.xkx
// Only the names of files containing selected lines are written to standard output.
egrep -o -l 'openTime:\d*ms' chat_timeout.xkx
// 在多个文件中查找匹配
egrep -o 'openTime:\d*ms' *.xkx
egrep -o 'openTime:\d*ms' chat_timeout.xkx chat_timeout_bak.xkx
> 可在下面留言(需要有 GitHub 账号)