How to handle ^@ characters in a file

Source: Internet
Author: User

Vim/proc/1/cmdline

Xxd/proc/1/cmdline found that the ^@ is the ' \ S ' End character

This can be handled as follows:

Cat/proc/1/cmdline | Tr ' + ' = '

In fact, this special character has been printed on the screen at Cat/proc/1/cmdline, but it is not visible, so it is handled by using TR to turn this invisible character into a visible character.

Subsequent processing:

First paragraph cat/proc/1/cmdline before removing the special symbol | Tr ' + ' = ' | Cut-d=-F1

The delimiter character followed by the cut-d can be only one character visible and cannot be an escape character

Sed-n l test.txt can display the \ t in the file

How to handle ^@ characters in a file

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.