Handy command to convert tabs to spaces

by Pete Houston


I found this is a pretty much handy command to convert tabs to spaces in many files

#!/bin/sh
# replace *.java by your language extension
find . -name '*.java' ! -type d -exec bash -c 'expand -t 4 "$0" > /tmp/e && mv /tmp/e "$0"' {} \;

I use it pretty much often with my projects.

Have fun ☺