Solved

Running dos2unix on a list of files

Posted on 2004-08-25
3
366 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
3 Comments
 
LVL 11

Accepted Solution

by:
griessh earned 200 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows Drag & Drop Location 2 94
C++ BOOL WINAPI ReadFile fails on windows 10 when reading from USB cable 9 377
centeredAverage challenge 8 130
unix example issues 18 73
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

911 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now