Remove spaces and tabs from line endings.
Section: Formatting and Cleanup
Trim trailing whitespace
bash
bash
sed 's/[[:space:]]*$//' file.txtExplanation
Useful before committing scripts, YAML, or source files.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Formatting and Cleanup