Replace \n with new line char in command output in LInux

21 Views Asked by At

I have a command which gives a big text and I want to replace all the \ns with actual new line char. Tried <my command> | tr '\\n' '\n' but its replacing ns as well along with \ns

echo $aa
Kanil\nSigtia

echo $aa | tr "\\\n" '\n'
Ka
il

Sigtia

I want

Kanil
Sigtia

or

Kanil

Sigtia

Dont mind either, its just for some logs, to make them readable

0

There are 0 best solutions below