Skip to main content
2 of 3
ensure sed sees the carriage return just before the newline
glenn jackman
  • 88.5k
  • 16
  • 124
  • 179

With sed, you can do:

sed -e 's/\r$//'

The same way can do with tr, you only have to remove \r:

tr -d '\r'
cuonglm
  • 158.2k
  • 41
  • 342
  • 420