我想用" AWK"或用sed打印所有以&QUOT启动线; COMM = QUOT;在一个文件中 [英] I want to use "awk" or sed to print all the lines that start with "comm=" in a file
本文介绍了我想用" AWK"或用sed打印所有以&QUOT启动线; COMM = QUOT;在一个文件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想用AWK或sed的打印所有以 COMM =
从文件开头的行 FILEX
,注意,每一行都包含COMM =财产以后
I want to use "awk" or "sed" to print all the lines that start with comm=
from the file filex
, Note that each line contains "comm=somthing"
for example : comm=rm , comm=ll, comm=ls ....
我怎样才能做到这一点?
How can i achieve that ?
推荐答案
有关与 COMM =
sed -n '/^comm=/p' filex
awk '/^comm=/' filex
如果 COMM =
是在该行的任何地方,然后
If comm=
is anywhere in the line then
sed -n '/comm=/p' filex
awk '/comm=/' filex
这篇关于我想用" AWK"或用sed打印所有以&QUOT启动线; COMM = QUOT;在一个文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文