sizeof - output the size of one or more files


This program outputs the size (in bytes) of one or more specified files. Optionally, it can also display the name of the file (the default is to output only the file size) and the total size of all the specified files.


        sizeof [-h | --help] [-v] [-t] file...


        -h, --help      Display this help message and exit.
        -v              Verbose mode.  Outputs file name in addition to
                        file size.
        -t              Total size of specified files.


        sizeof *.txt

Lists the sizes of each of the specified files.

        sizeof -t *.txt

Lists the total size (in bytes) of all of the specified files.

        sizeof -v *.txt

Lists both the size and the name of each of the specified files.


Just put it someplace useful. How about /usr/local/bin?

Tested With:

Tested with Red Hat v5.2 and 7.2. Should work with bash anywhere. Uses awk and printf.


Copyright 2000-2002, William Shotts <>

This software is part of the project, a site for Linux education and advocacy devoted to helping users of legacy operating systems migrate into the future.

You may contact the project at:


This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

$Id: sizeof.README,v 1.2 2002/02/18 14:18:38 bshotts Exp $