filesize

Package: WA2L/edrc 1.5.57
Section: Library Commands (3)
Updated: 20 September 2008
Index Return to Main Contents

 

NAME

filesize - print size of a file

 

SYNOPSIS

edrc/lib/filesize [ -h ]

filesize [ -b | -k | -m | -g ] -f file

 

AVAILABILITY

WA2L/edrc

 

DESCRIPTION

return the size of a given file.

The file size is returned as an integer number of the selected unit option. If the file size is not integer the returned file size is rounded up by one. Therefore if the real file size is 123.01 kBytes, 124 would be returned.

If a more precise file size is needed for units other then Bytes ( -b ) the size has to be queried in Bytes first and then the related calculation has to be done separately:

        filesize -f /data/example.dmp |\
          awk '{printf("%3.2f\n", $1/1024)}'

 

OPTIONS

-h
print usage message.

-b
return the file size in Bytes, this is also the default if no unit option is specified.

-k
return the file size in kilo bytes (1 kByte = 1024 Byte).

-m
return the file size in mega bytes (1 MByte = 1024 kByte).

-g
return the file size in giga bytes (1 GByte = 1024 MByte).

-f file
path of the file from which the size should be returned.

 

ENVIRONMENT

-

 

EXIT STATUS

0
no error.

1
given file does not exist.

2
operating system does not exist. See osid(3) if you get this error.

4
usage message printed.

 

FILES

-

 

EXAMPLES

-

 

SEE ALSO

edrcintro(1), filewatch(3), freespace(3), bdf(1), df(1)

 

NOTES

-

 

BUGS

-

 

AUTHOR

filesize was developed by Christian Walther. Send suggestions and bug reports to wa2l@users.sourceforge.net . 

 

COPYRIGHT

Copyright © 2008 Christian Walther

This is free software; see edrc/doc/COPYING for copying conditions. There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


 

Index

NAME
SYNOPSIS
AVAILABILITY
DESCRIPTION
OPTIONS
ENVIRONMENT
EXIT STATUS
FILES
EXAMPLES
SEE ALSO
NOTES
BUGS
AUTHOR
COPYRIGHT

This document was created by man2html using the manual pages.
Time: 16:53:00 GMT, August 28, 2024