Is there a "standard" command that will do this? It's something I've always wondered about
I currently have a rudimentary script to do it ...
#!/bin/ksh
# list n largest files under current directory (recursive)
[ $# != 1 ] && {
echo "Usage: findbig <number to list>"
exit 1
}
find . -type f -exec ls -l {} \;|tr -s " "|sort -k 5n|tail -$1|awk 'BEGIN {printf("\nBytes\tFilename\n---------------------\n"
} {printf("%s\t%s\n"
, $5, $9}'
and another variation to just do the current directory.
Was just wondering if anyone else has another way?
Greg.
#!/bin/ksh
# list n largest files under current directory (recursive)
[ $# != 1 ] && {
echo "Usage: findbig <number to list>"
exit 1
}
find . -type f -exec ls -l {} \;|tr -s " "|sort -k 5n|tail -$1|awk 'BEGIN {printf("\nBytes\tFilename\n---------------------\n"
and another variation to just do the current directory.
Was just wondering if anyone else has another way?
Greg.