Use Cat command to display hidden characters under Linux system

Source: Internet
Author: User

Linux system, the use of ordinary text editor to view, some characters are not displayed, this need to use the Cat command to view, the following small series to introduce the next Linux use Cat command to view hidden characters, together to understand the next bar.

First, we create a simple text file that writes some special characters. Open the terminal and run the command:

printf ' testing121111testing141012more testing1211001300even more testing1211111112 ' "/tmp/testing.txt

Now open with a different editor software, the results will be different. Open with a simple cat will show:

$ cat/tmp/testing.txt

Testing

Testing

More testing

Even more testing

If you open it with nano or VIM, you will see:

Testing

Testing^l^h

More testing

^@^k^ @even More Testing

Now let's add some option parameters to the cat so that we can display special characters.

Use the CAT-T command to display the TAB key character ^i

Cat-t/tmp/testing.txt

Testing

^i^itesting

More testing

^i

Even more testing

^i^i^i

Use the CAT-E command to display end characters for line endings $

$ cat-e/tmp/testing.txt

testing$

Testing

$

More testing$

Even more testing$

$

With a simple cat-a command, you can display all the characters that are not visible:

$ cat-a/tmp/testing.txt

testing$

^i^itesting^l^h$

More testing$

More testing$

^i^i^i$

Related Article

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.