About me

Just another Wordpress.com weblog

Recursive dos2unix

Following command helped in converting more than 10000 windows formated xml and other files to unix. that too in very short time span.

$ find . -name *.* -exec dis2unix {} \;

About these ads

July 15, 2006 - Posted by | *nix

16 Comments »

  1. Thanks for this, I used a modified version to convert a bunch of .cpp and .h files. Very useful.

    Comment by Josh | March 14, 2007 | Reply

  2. This thing helps me.

    yc

    Comment by Yuen-Chi Lian | October 29, 2007 | Reply

  3. Your one doesn’t work for me, I got this error:

    find: paths must precede expression
    Usage: find [-H] [-L] [-P] [path...] [expression]

    Instead, this one works well: find . -type f -exec dos2unix {} \;

    Comment by Eric Lin | November 12, 2007 | Reply

    • Worked for me, thanks Eric

      Comment by krithi | May 8, 2012 | Reply

  4. Didn’t really work very well for me. I used the following command instead:

    $ dos2unix `find ./ -type f`

    (note that it’s backtick (`) and not single quote (‘))

    Comment by Abhiram | November 21, 2007 | Reply

    • thanks it worked …
      and helped me a lot

      Comment by nethra | March 14, 2014 | Reply

  5. Abhiram: “argument list too long”.
    Looks like Eric Lin’s thing works ok.

    Comment by Khaos | November 24, 2007 | Reply

  6. Khaos: It works fine for me but Eric’s doesn’t. Maybe it is specific to my setup.

    Comment by Abhiram | January 4, 2008 | Reply

  7. if is argument list too long use it with xarg command

    Comment by joe | January 13, 2008 | Reply

  8. [...] After trying to do a recursive dos2unix call, as detailed in the following blog post: http://cyberzen.wordpress.com/2006/07/15/recursive-dos2unix/ [...]

    Pingback by find: paths must precede expression « Aaron’s Blog | July 6, 2008 | Reply

  9. thank you, this has helped!

    Comment by sa | July 7, 2008 | Reply

  10. I had a subversion working copy so my problem was the .svn configuration directories. I modified the command to this:

    find -type f -not \( -wholename ‘*svn*’ \) -exec dos2unix {} \;

    Comment by Edakos | March 17, 2009 | Reply

  11. for file in `find ./`; do dos2unix $file $file; done

    HTH…
    Maku

    Comment by makuchaku | April 13, 2009 | Reply

  12. that doesn’t work in solaris 10…
    use below command
    for i in `find . -type f` ; do dos2unix $i $i; done

    Comment by linneighborhood | December 21, 2009 | Reply

  13. find $RELEASE_DIR -name “*.xml” -exec dos2unix {} \;

    Comment by Narendra Kumar Achari | January 13, 2010 | Reply

  14. Try find . -name \*.* -exec dos2unix {} \;

    Comment by cdel | April 4, 2013 | Reply


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: