Windows line endings consist of the two-character sequence CR, LF. CR is the carriage return character, sometimes represented as \r, \015, ^M, etc. A Unix line ending is just the LF character.
A way to convert Windows line endings to Unix line endings using only standard utilities present on all Unix variants is to use the tr utility.
tr -d '\r' <thefile >thefile.new && mv thefile.new thefile
If the file already has Unix line endings, its content won't be changed.
If you have many files to transform in the current directory, you can use a loop. Assuming that you don't have any files whose name ends with .new:
for x in *; do
tr -d '\r' <"$x" >"$x.new" && mv "$x.new" "$x"
done
Under Linux (excluding some embedded Linux systems) or Cygwin, you can use sed. The -i option to edit a file in place is specific to these systems. The notation \r for a CR character is more widespread but not universal.
sed -i -e 's/\r//g' thefile