I want to use “awk” or sed to print all the lines that start with “comm=” in a file

后端 未结 4 1066
情歌与酒
情歌与酒 2021-01-02 03:30

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\"

4条回答
  •  渐次进展
    2021-01-02 04:23

    For lines that start with comm=

    sed -n '/^comm=/p' filex
    
    awk '/^comm=/' filex
    

    If comm= is anywhere in the line then

    sed -n '/comm=/p' filex
    
    awk '/comm=/' filex
    

提交回复
热议问题