How to remove trailing whitespaces for multiple files?
Are there any tools / UNIX single liners which would remove trailing whitespaces for multiple files in-place . E.g. one that could be used in the conjunction with find . You want sed --in-place 's/[[:space:]]\+$//' file That will delete all POSIX standard defined whitespace characters, including vertical tab and form feed. Also, it will only do a replacement if the trailing whitespace actually exists, unlike the other answers that use the zero or more matcher ( * ). --in-place is simply the long form of -i . I prefer to use the long form in scripts because it tends to be more illustrative of