Skip to content

Instantly share code, notes, and snippets.

@bluefuton
Created December 12, 2011 16:15
Show Gist options
  • Star 22 You must be signed in to star a gist
  • Fork 9 You must be signed in to fork a gist
  • Save bluefuton/1468061 to your computer and use it in GitHub Desktop.
Save bluefuton/1468061 to your computer and use it in GitHub Desktop.
OS X: replace tabs with spaces in all files using expand
find . -name "*.php" | while read line; do expand -t 4 $line > $line.new; mv $line.new $line; done
@schrockwell
Copy link

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

@phackwer
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