Skip to content

Instantly share code, notes, and snippets.

Created December 12, 2011 16:15
What would you like to do?
OS X: replace tabs with spaces in all files using expand
find . -name "*.php" | while read line; do expand -t 4 $line > $; mv $ $line; done
Copy link

Thanks! For anyone reading this, replace the option -t 4 with the number of spaces you wish to replace each tab with.

Copy link

phackwer commented Nov 5, 2017

Thanks. I was going crazy trying to use linux commands on mac os. Even freebsd commands are not 100% in mac. This saved me a lot of time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment