LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-13-2014, 03:08 AM   #1
ilesterg
Member
 
Registered: Jul 2012
Distribution: Arch, Debian, and CentOS/RHEL
Posts: 541

Rep: Reputation: 56
Cool 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.
 
Old 01-13-2014, 03:14 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
Try option -v
Code:
-v, --show-nonprinting
       use ^ and M- notation, except for LFD and TAB
 
Old 01-13-2014, 03:19 AM   #3
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 1,325

Rep: Reputation: 225Reputation: 225Reputation: 225
have you tried cat: filename.txt -v
 
  


Reply

Tags
ascii mode, binary mode, cat, vi


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Display Files After Sorting (sort then cat) ali2011 Programming 7 08-25-2012 03:49 PM
Script, display contents of a file using cat Lindy70 Linux - Newbie 2 05-08-2012 10:13 AM
VIM, NANO, Gedit, CAT display VISUDO as garbage xtropx Linux - Newbie 7 04-30-2012 01:18 PM
LXer: Using Cat Command in Linux To Create,Display,Append and Concatenate files LXer Syndicated Linux News 0 08-01-2011 04:50 PM
Display damaged by cat: Way to fix? dumluks Linux - Hardware 6 03-25-2008 06:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration