LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   cat does not display ^M? (https://www.linuxquestions.org/questions/linux-newbie-8/cat-does-not-display-%5Em-4175491089/)

ilesterg 01-13-2014 03:08 AM

cat does not display ^M?
 
Hey guys,

I have this txt/flat file which I scp'd from a Windows box to a Unix box through Binary mode (yes, ASCII mode should be used).

When using vi on the file, the ^M special characters can be seen at the end of each line. Which makes sense, right?

However, when reading the file through cat, I don't see the special characters. I have always believed cat should be able to see the special characters. Why can't it? Am I missing anything here?

Thank you.

colucix 01-13-2014 03:14 AM

Try option -v
Code:

-v, --show-nonprinting
      use ^ and M- notation, except for LFD and TAB


JJJCR 01-13-2014 03:19 AM

have you tried cat: filename.txt -v


All times are GMT -5. The time now is 10:18 AM.