[shell] sed replace to \n

[shell] sed replace to \n
0 votes, 0.00 avg. rating (0% score)

sed is utility to replace particular text with new text in files.

s/// doesn’t work with \n
use y/// for \n replacement

sed 'y/ /\n/g'

Or you can use ‘tr’

$> tr -s '~' '\n' < inputfile > outputfile

Leave a Reply

Your email address will not be published. Required fields are marked *