How can I convert tabs to spaces in every file of a directory?
问题 How can I convert tabs to spaces in every file of a directory (possibly recursively)? Also, is there a way of setting the number of spaces per tab? 回答1: Warning: This will break your repo. This will corrupt binary files , including those under svn , .git ! Read the comments before using! find . -type f -exec sed -i.orig 's/\t/ /g' {} + The original file is saved as [filename].orig . Downsides: Will replace tabs everywhere in a file. Will take a long time if you happen to have a 5GB SQL dump