$ 0 0 You could do this using sed and tr:sed 's/$/\\n/' file | tr -d '\n'However this will add an extra \n at the end.