Skip to content

Instantly share code, notes, and snippets.

@netwjx
Created September 8, 2022 06:46
Show Gist options
  • Save netwjx/248500e67083078249a8760d41747268 to your computer and use it in GitHub Desktop.
Save netwjx/248500e67083078249a8760d41747268 to your computer and use it in GitHub Desktop.
批量处理文件
➜ ls | xargs -i echo mv {} {} | sed 's/.txt/.md/2g'
mv 0001.txt 0001.md
mv 0002.txt 0002.md
mv 0003.txt 0003.md
mv 0004.txt 0004.md
mv 0005.txt 0005.md
ls | xargs -i echo mv {} {} | sed 's/.png/.txt/2g' | sh

各目录git commit量

ls | xargs -I {} echo 'echo $(git log --since='2022-03-01' --oneline {}|wc -l) {}' | sh | sort -n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment