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