Convert 2->4 Space Indentation In place Converts all .py files from 2->4 space indentation find ./ -iname "*.py" -type f -exec perl -i -pe's{^((?: {2})*)}{" " x (4*length($1)/2)}e' {} + Change -iname "*.py" to match other file types.