Replacing Control Character in sed

后端 未结 5 2003
再見小時候
再見小時候 2020-12-01 03:29

I need to replace all occurrences of the control character CTRL+A (SOH/ascii 1) in a text file in linux, how can this be achieved in SED?

5条回答
  •  广开言路
    2020-12-01 03:58

    Try:

    sed 's/^A/foo/g' file
    

    Use Ctrl+V+A to create the ^A sequence in the above command.

提交回复
热议问题