====== BASH - Files - Delete trailing whitespace (spaces or tabs) from end of each line in a file ====== Delete the trailing whitespace (spaces or tabs) from end of each line. awk '{sub(/[ \t]+$/, "");print}' filename