Often, a program or software does not have a grammatical error, and you do not see the problem when you check its contents. This is because there are many characters that are not displayed when you use the normal text editor software, but it is easy to detect the presence of these characters in the terminal using the Cat command.
~ First, we create a simple text file that writes some special characters. Open terminal, Run command:
printf ' Testing\012\011\011testing\014\010\012more testing\012\011\000\013\000even more testing\012\011\011\ 011\012 '>/tmp/testing.txt
Now open with different editor software, the results will be different. Open with a simple cat will display:
$ cat/tmp/testing.txt
Testing
Testing
More testing
Even more testing
If you open 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 cat so that special characters can be displayed.
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 the ending character of the end of a line $
$ cat-e/tmp/testing.txt
testing$
Testing
$
More testing$
Even more testing$
$
All invisible characters can be displayed with a simple cat-a command:
$ cat-a/tmp/testing.txt
testing$
^i^itesting^l^h$
More testing$
^i^@^k^ @even More testing$
^i^i^i$
Linux endpoints: view invisible characters with cat commands