2014-07-12 14:21:40

View Mode: Normal | Article List
Category: Unix | 1

Mac 批量修改文件编码 批量重命名

[ 2012-11-17 16:28:12 | Author: zhenhua ]
修改文件编码:
find *.java -exec sh -c "iconv -f GB18030 -t UTF8 {} > {}.java" \;
find *.java -exec sh -c "iconv -f GB18030 -t UTF-8 {} >utf/{}" \;
find . -type f -name *.java -exec sh -c "iconv -f GB18030 -t UTF8 {} > {}.java" \;

重命名:
for i in *.java;do mv "$i" "${i%.java.java}.java" ;done

删除
rm -rf `find . -type f -name *.bak`

删除目录
rm -rf `find . -type d -name .svn|xargs `

Mac su:Sorry mac下获取root权限

[ 2012-08-29 19:13:48 | Author: zhenhua ]
sudo su

permission denied

chmod +x kill.sh
1