<p>How can you remove all of the trailing whitespace of an entire project? Starting at a root directory, and removing the trailing whitespace from all files in all folders.</p>

<p>Also, I want to to be able to modify the file directly, and not just print everything to stdout.</p>

In Bash:
```
find dir -type f -exec sed -i 's/ *$//' '{}' ';'
```
Note: If you're using
```
.git
```
repository, try adding:
```
-not -iwholename '.git'
```
.