find . -name '*' -type f -printf '%b.%f\0' | awk -F . -v RS='\0' '{if (NF==2) $(NF+1)=" "; s[$NF] += $1; n[$NF]++} END {for (e in s) printf "%15d %6d %s\n", s[e]*512, n[e], e}' | sort -rn | numfmt --to=iec-i --suffix=B
Monday, February 07, 2022
How to find total filesize grouped by extension
How can I recursively delete all files of a specific extension in the current directory?
You don't even need to use rm in this case if you are afraid. Use find: find . -name "*.bak" -type f -delete But use it with precaution. Run first: find . -name "*.bak" -type f to see exactly which files you will remove.
Sunday, February 06, 2022
Unzip All Files In A Directory
This works in bash, according to this link: unzip \*.zip or Just put in some quotes to escape the wildcard: unzip "*.zip"
Thursday, February 03, 2022
Subscribe to:
Posts (Atom)
Git get all remote branches
git branch -r \ | grep -v '\->' \ | sed "s,\x1B\[[0-9;]*[a-zA-Z],,g" \ | while read remote; do \ git branc...
-
sh -c 'xfce4-screenshooter --fullscreen --save "$HOME/Pictures/Screenshots/Screenshot_$(date +%Y-%m-%d_%H:%M:%S).png"' s...
-
Known Issues Firefox 3.5 will only support color profiles as specified by ICC v2, later versions will add su...