The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Can I know find syntax to find given date files bache_gowda Shell Programming and Scripting 3 03-26-2008 02:37 AM
Find duplicates from multuple files with 2 diff types of files ricky007 Shell Programming and Scripting 2 03-04-2008 09:46 AM
Little bit weired : Find files in UNIX w/o using find or where command jatin.jain Shell Programming and Scripting 10 09-19-2007 03:47 AM
how to find duplicate files with find ? umen Shell Programming and Scripting 8 09-04-2006 12:01 AM
Find files older than 20 days & not use find halo98 Shell Programming and Scripting 2 05-18-2006 11:19 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-21-2007
Registered User
 

Join Date: Aug 2005
Posts: 229
How can i find all the files contains ^M ?

hi
i have lots of text files that contains ^M , now i like to remove them
using dos2unix but first i need to find all of them , what is the best way to do that ?
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 02-22-2007
aigles's Avatar
Registered User
 

Join Date: Apr 2004
Location: Bordeaux, France
Posts: 1,199
You can get the list of files containing ^M with the command (^M = ctrl/V+ctrl/M) :
Code:
grep -l "^M" *

Jean-Pierre.
Reply With Quote
  #3 (permalink)  
Old 02-22-2007
Registered User
 

Join Date: Feb 2006
Location: Schenectady, NY
Posts: 130
As an aside, you can run dos2unix against a text file without carriage returns with no ill effect. Sometimes its easier to just apply the same command against an entire directory.
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 12:42 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0