for file in ./* ; do mv "$file" "$(echo $file|sed -e 's/([A-Z])/_L1/g' -e 's/^./_//')" ; done
批量修改文件名
for filename in *foo*; do echo mv "$filename" "${filename//foo/bar}"; done > rename.txt
修改头文件包含
find . -name "*.cpp" -exec sed -e "s#enum_#enum/#p" {} ; >1.txt
参考:
http://www.peteryu.ca/tutorials/shellscripting/batch_rename