Linux – Size command in linux

linux

What exactly does the size command (sans any flags) return in linux? if we are using a compiled assembler sourcecode, will this return the size useded by the program?

many thanks

Best Answer

From the man page:

The GNU size utility lists the section sizes---and the total size---for each of the object or archive files objfile in its argument list. By default, one line of output is generated for each object file or each module in an archive.

Here's an example output from running size foo.static

   text    data     bss      dec    hex filename
6803811  221704 3419168 10444683 9f5f8b foo.static

This gives you the size of the text segment (also known as code segment), data segment, block started by symbol. dec is the size of the text, data and bss size added together. hex is the same number in hexadecimal.

Related Question