What is the benefit of –squeeze-repeats in tr command

tr

What is the benefit of -s or --squeeze-repeats when we use tr? What practical usage?

Best Answer

The GNU coreutils manual gives some example applications such as collapsing multiple newlines into one (tr -s '\n'), or putting each word on its own line while removing punctuation at the same time (tr -cs '[:alnum:]' '[\n*]').

Related Question