Replace newlines with spaces.
Section: tr Translation and Character Operations
Join lines into one line
bash
bash
tr '
' ' ' < lines.txtExplanation
Useful when flattening simple lists into a single line of text.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing tr Translation and Character Operations
Convert lowercase to uppercase
Translate characters from lower to upper case.
Extract comma-delimited fields
Print the first and third fields from a CSV-like file.