You can use cat -E or –show-ends option to display a dollar sign ($) at each line ending.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
## Add data in your file echo -e "one\ntwo\n\nthree" > myfile ## Display a dollar sign ($) at each line ending cat -E myfile ## returns $ at the end of each line even if the line is empty ## one$ ## two$ ## $ ## three$ ## Without any options cat myfile ## returns ## one ## two ## ## three |