随笔分类 -  小脚本

摘要:@echo off rem oLink.Arguments rem oLink.Description rem oLink.HotKey rem oLink.IconLocation rem oLink.WindowStyle rem oLink.WorkingDirectory set SCRIP 阅读全文
posted @ 2021-03-10 11:36 wolbo 阅读(373) 评论(0) 推荐(0) 编辑
摘要:find . \( -name "*.cpp" -o -name "*.hpp" -o -name "*.h" \) -exec wc -l {} + 阅读全文
posted @ 2021-01-25 16:20 wolbo 阅读(154) 评论(0) 推荐(0) 编辑
摘要:for file in *.png; do mv "$file" "${file%.png}_3.6.14.png" done for file in `find -name "*.old"` ; do mv ${file} ${file%.old}; done; 使用find -exec find 阅读全文
posted @ 2021-01-07 13:33 wolbo 阅读(93) 评论(0) 推荐(0) 编辑
摘要: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 参 阅读全文
posted @ 2021-01-05 13:38 wolbo 阅读(534) 评论(0) 推荐(0) 编辑
摘要:在文件开始追加一行 1 使用sed(会改变文件编码为utf-8) find -name "*.cpp" -exec sed -i '1s@^@added line\n@' {} \; #sed insert append #第一行行前插入一行 sed -i '1i added line' main. 阅读全文
posted @ 2020-12-26 11:19 wolbo 阅读(460) 评论(0) 推荐(0) 编辑
摘要:ls -l *.h | awk '{print$9}' 阅读全文
posted @ 2020-12-18 16:43 wolbo 阅读(347) 评论(0) 推荐(0) 编辑
摘要:for file in ./* ; do mv "$file" "$(echo $file|sed -e 's/\([A-Z]\)/_\L\1/g' -e 's/^.\/_//')" ; done 批量修改文件名 for filename in *foo*; do echo mv \"$filena 阅读全文
posted @ 2020-12-17 10:07 wolbo 阅读(96) 评论(0) 推荐(0) 编辑
摘要:for file in ./* ; do mv "$file" "$(echo $file|sed -e 's/\([A-Z]\)/_\L\1/g' -e 's/^.\/_//')" ; done 参考: https://askubuntu.com/questions/844738/rename-a 阅读全文
posted @ 2020-12-14 15:17 wolbo 阅读(66) 评论(0) 推荐(0) 编辑
摘要:awk -F' ' '{print>$2}' log.log 以空格为分隔符 将当前行输出至第二列的文件中 如果列以| 分隔 则需加转义 -F\| 参考: https://stackoverflow.com/questions/59974705/how-to-include-all-header-f 阅读全文
posted @ 2020-12-12 14:08 wolbo 阅读(271) 评论(0) 推荐(0) 编辑
摘要:echo $# if [ $# -lt 2 ]; then echo "input basis folder base:" read src echo "input target folder base:" read target echo "input output folder base:" r 阅读全文
posted @ 2020-10-13 17:55 wolbo 阅读(149) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示