Data processing

Frequently Asked Questions

How to remove trailing whitespace from a file?

sed -i 's/[[:space:]]*$//' FILE

» Full answer and more examples


How to insert a line at the beginning of a file?

sed -i '1i # New first line' FILE

» Full answer and more examples


See all frequently asked questions for Data processing