How can I convert tabs to spaces in every file of a directory?

后端 未结 19 1284
既然无缘
既然无缘 2020-12-02 03:48

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?

19条回答
  •  不思量自难忘°
    2020-12-02 04:08

    Converting tabs to space in just in ".lua" files [tabs -> 2 spaces]

    find . -iname "*.lua" -exec sed -i "s#\t#  #g" '{}' \;
    

提交回复
热议问题