Size (Unix)
Encyclopedia
size is a command line utility originally written for use with the Unix-like
Unix-like
A Unix-like operating system is one that behaves in a manner similar to a Unix system, while not necessarily conforming to or being certified to any version of the Single UNIX Specification....

 operating systems. It processes one or more ELF
Executable and Linkable Format
In computing, the Executable and Linkable Format is a common standard file format for executables, object code, shared libraries, and core dumps. First published in the System V Application Binary Interface specification, and later in the Tool Interface Standard, it was quickly accepted among...

 files and its output are the dimensions (in bytes) of the text
Code segment
In computing, a code segment, also known as a text segment or simply as text, is one of the sections of a program in an object file or in memory, which contains executable instructions....

, data
Data segment
A data segment is a portion of virtual address space of a program, which contains the global variables and static variables that are initialized by the programmer...

 and uninitialized
.bss
In computer programming, the name .bss or bss is used by many compilers and linkers for a part of the data segment containing statically-allocated variables represented solely by zero-valued bits initially...

 sections, and their total.

Common use:
$ size

Here follows some examples on Solaris
Solaris Operating System
Solaris is a Unix operating system originally developed by Sun Microsystems. It superseded their earlier SunOS in 1993. Oracle Solaris, as it is now known, has been owned by Oracle Corporation since Oracle's acquisition of Sun in January 2010....

 (/usr/ccs/bin/size); options and syntax may vary on different Operating Systems:

$ size /usr/ccs/bin/size
9066 + 888 + 356 = 10310

With -f option name and size of each section are printed out, plus their total:
$ size -f /usr/ccs/bin/size
17(.interp) + 636(.hash) + 1440(.dynsym) + 743(.dynstr) + 64(.SUNW_version) + 48(.rela.ex_shared) + 24(.rela.bss) + 336(.rela.plt) + 4760(.text) +
80(.init) + 80(.fini) + 4(.exception_ranges) + 28(.rodata) + 590(.rodata1) + 12(.got) + 388(.plt) + 192(.dynamic) + 40(.ex_shared) + 112(.data) +
140(.data1) + 352(.bss) = 10086

With -F option size and permission flag of each sections are printed out, plus their total:

$ size -F /usr/ccs/bin/size
9066(r-x) + 1244(rwx) = 10470
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK