Search code examples
terminaltail

Line breakes missing when using tail command


I'm using the tail command to monitor a log file on Os X.

command: tail -f path_to_file

When viewing the result in the terminal window, the line breaks are missing.

The log statements have '\r' to create a new line. It seems this character is skipped by the tail app.

How can I fix this?


Solution

  • Try something like this to convert \r to \n with sed. If it is available on Os X

    tail -f path_to_file | sed 's/\\r/\n/g'