for file in `find . -type f -name "*.hpp"`; do
   mv "$file" "$file.old" && iconv -f GB2312 -t UTF-8 < "$file.old" > "$file" && rm -rf "$file.old"
done

 

 

参考:

https://stackoverflow.com/questions/17267226/batch-converting-file-encoding

 

find 多条件连接

https://unix.stackexchange.com/questions/50612/how-to-combine-2-name-conditions-in-find

相关文章:

  • 2021-11-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-14
  • 2022-12-23
  • 2021-09-25
猜你喜欢
  • 2021-06-24
  • 2022-12-23
  • 2022-12-23
  • 2022-03-02
  • 2022-12-23
  • 2022-12-23
  • 2021-11-12
相关资源
相似解决方案