Skip to content

Conversation

@hginzel
Copy link

@hginzel hginzel commented Aug 7, 2025

How to remove trailing whitespace of all files recursively?

(export LANG=C LC_CTYPE=C
find . -type d \( -name .svn -o -name .git \) -prune -o -type f -print0 | perl -0ne 'print if -T' | xargs -0 sed -Ei 's/[[:blank:]]+$//' )

https://stackoverflow.com/questions/149057/how-to-remove-trailing-whitespace-of-all-files-recursively
(export LANG=C LC_CTYPE=C
find . -type d \( -name .svn -o -name .git \) -prune -o -type f -print0 | perl -0ne 'print if -T' | xargs -0 sed -Ei 's/[[:blank:]]+$//'
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant