Solved

Running dos2unix on a list of files

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

728 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