How to get a size file in Bash

03 Nov 2013 » {[{categoryPostCurrent}]}

The trick consist to use the stat -c%s myfilenamecommand.

Hereunder[^1] is a bash script that perform the job:

    if [ $# -eq 2 ]; then
        echo "usage: $0 filename"
        FILESIZE=$(stat -c%s "$FILENAME")
        echo "Size of $FILENAME = $FILESIZE bytes."

[^1]: Est dignitati ille publicae tributus tot hac eadem est tot quod cum et maxime Ergo.

Voir aussi...

comments powered by Disqus