Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google site



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

Closed Thread
English Japanese Spanish French German Portuguese Italian Powered by Powered by Google
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 02-22-2007
Registered User
 

Join Date: Aug 2005
Posts: 239
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 ?
Sponsored Links
  #2 (permalink)  
Old 02-22-2007
aigles's Avatar
aigles aigles is offline Forum Advisor  
Registered User
 

Join Date: Apr 2004
Location: Bordeaux, France
Posts: 1,434
You can get the list of files containing ^M with the command (^M = ctrl/V+ctrl/M) :

Code:
grep -l "^M" *


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

Join Date: Feb 2006
Location: Schenectady, NY
Posts: 134
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.
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


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 06:37 AM
Find duplicates from multuple files with 2 diff types of files ricky007 Shell Programming and Scripting 2 03-04-2008 01:46 PM
Little bit weired : Find files in UNIX w/o using find or where command jatin.jain Shell Programming and Scripting 10 09-19-2007 07:47 AM
how to find duplicate files with find ? umen Shell Programming and Scripting 8 09-04-2006 04:01 AM
Find files older than 20 days & not use find halo98 Shell Programming and Scripting 2 05-18-2006 03:19 PM



All times are GMT -4. The time now is 10:04 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2010. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0