Space at beginning of the line

How can I delete spaces at the begining of all lines of my file ?

sed -i "s/^ *//g" inputfile

or

perl -i -pe 's/^\s+//g' inputfile

There should be lots of threads on this one. Did you try searching the forum?

1 Like

Thanks , i did not work at first , but I replaced -i with -u then it woked