How 2 Know
If you can't Google it, You Can Knowing it.

how to see hidden char in file

some times you transfer files from windows to Linux or UNIX using binary method, you will find some hidden characters  on the file, to display these hidden character  use commands “cat” with option “vte” see the following examples:

the first example without options

[root@Linux1 ~]# cat  script.sh
#!/bin/sh
for i in `ls -l /`
do
echo $i
done

and this one with “VTE” option

[root@Linux1 ~]# cat -vte script.sh
#!/bin/sh^M$
for i in `ls -l /`^M$
do^M$
echo $i^M$
done^M$

the end line must be “$”, and you will notice the hidden characters “^M”. to remove this hidden character see the following LINK:
http://how-2-know.com/main/2013/01/28/removing-control-characters/

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from How 2 Know

Subscribe now to keep reading and get access to the full archive.

Continue reading