delete files
delete large amount of files
find ./ -name "*.jar" -mtime +7 -size +30M -exec rm -rf {} \;
ls -alrst|head -n 30|awk '{print $10}'|xargs rm
Clean up old git branches
# DANGER! Only run these if you are sure you want to delete unmerged branches.
# delete all local unmerged branches
git branch --no-merged | egrep -v "(^\*|main|test|dev)" | xargs git branch -D
# delete all local branches (merged and unmerged).
git branch | egrep -v "(^\*|main|test|dev)" | xargs git branch -D
# DANGER! Only run these if you are sure you want to delete unmerged branches.
# delete all remote unmerged branches
git branch -r --merged | egrep -v "(^\*|main|test|dev)" | sed 's/origin\///' | xargs -n 1 git push origin --delete
# delete all remote branches (merged and unmerged).
git branch -r | egrep -v "(^\*|main|dev|test)" | sed 's/origin\///' | xargs -n 1 git push origin --delete