(On windows) By default Perl changes the value of “\n” to CRLF. This means that the regex match: “/\015\012/” will fail on Windows as Perl is actually running: “/\015\015\012/“. Regexes using meta-characters and hex codes (”/\r\n/” and “/\x0d\x0a/“) fail for the same reason. ... perl -pe "binmode(STDOUT);s/\R/\012/" /path/to/file > /path/to/new/file