Created
May 22, 2019 09:57
-
-
Save klashxx/942fd1f7fcaf9973a731af018fac9511 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
[[ $# -ne 0 ]] && { fs="${1}"; shift; } || fs="." | |
[[ ! -d $fs || ! -r $fs ]] && { echo "not dir/cant read it"; exit 5; } | |
[[ $# -ne 0 ]] && tam=$1 || tam=1 | |
[[ ! $tam =~ ^[0-9]{1,}$ ]] && { echo "param must be a number (mbs)"; exit 5; } | |
(( tam *= 1024 * 1024 )) | |
find $fs -size +${tam}c -exec ls -ln {} \; 2>/dev/null | \ | |
sort -r -k 5n | \ | |
awk '{printf("%12.3f %s %s %s %s\n", $5/1024/1024, $NF, "("$7,$6,$8")")}' | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment