?
Solved

Running dos2unix on a list of files

Posted on 2004-08-25
3
Medium Priority
?
373 Views
Last Modified: 2013-12-26
Hi,

I have a directory structure, with loads of files in. I can find all the files simply by doing

find ./ -type file -name "*" -print

However, I then want to run dos2unix on each of these files, and preserve the original name. For example

dos2unix dave dave

Any ideas on how to do this as a one liner, or a few lines?

Thanks

Alistair
0
Comment
Question by:Alistair_Williams
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 11

Accepted Solution

by:
griessh earned 800 total points
ID: 11891609
Hi Alistair_Williams,

 find ./ -type file -name "*" -print | xargs dos2unix


======
Werner
0
 
LVL 4

Expert Comment

by:Magic55
ID: 11891620
find . -type f -name "*" | xargs dos2unix
/ TK
0
 
LVL 18

Expert Comment

by:liddler
ID: 11891678
Slightly simpler
find . -type f -exec dos2unix {} \;
You don't need the -name and using find's exec option is more efficient than passing to xargs
0

Featured Post

Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question