Entonces su archivo se verá así usando od
ocat -A
$ od -c foo
0000000 l i n e 1 \t \n l i n e 2 \t \n l i
0000020 n e 3 \t \n
0000025
$ cat -A foo
line1^I$
line2^I$
line3^I$
$
Para eliminar todos los^I
(Tabulador)caracteres, puede usar sed -i 's/\t//g' foo
. Para solo eliminar las pestañas al final de una línea, se usased -i 's/\t$//' foo
$ sed -i 's/\t//g' foo
$ od -c foo
0000000 l i n e 1 \n l i n e 2 \n l i n e
0000020 3 \n
0000022
$ cat -A foo
line1$
line2$
line3$
$