Solved

Running dos2unix on a list of files

Posted on 2004-08-25
3
365 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

746 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

9 Experts available now in Live!

Get 1:1 Help Now