grep for special characters in Unix

后端 未结 6 512
你的背包
你的背包 2020-12-02 06:02

I have a log file (application.log) which might contain the following string of normal & special characters on multiple lines:

*^%Q&$*&^@$&*!         


        
6条回答
  •  离开以前
    2020-12-02 06:52

    grep -n "\*\^\%\Q\&\$\&\^\@\$\&\!\^\@\$\&\^\&\^\&\^\&" test.log
    1:*^%Q&$&^@$&!^@$&^&^&^&
    8:*^%Q&$&^@$&!^@$&^&^&^&
    14:*^%Q&$&^@$&!^@$&^&^&^&
    

提交回复
热议问题