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

  • 5
    what does "man size" say?
    – nb2580
    Dec 8, 2009 at 12:36
  • The question would be more convincing if you said you had already tried man size and didn't understand something in the information provided. As it is, the best answer is repeating the information from the man page.
    – Pascal Cuoq
    Dec 8, 2009 at 12:37
  • 2
    lol, man size... almost as humorous as touch me Dec 8, 2009 at 12:37
  • sorry, i did try man size - and ive tried it witha number of complied programs "size - list section sizes and total size. " is from the manual, but i cant make much headway with determining what this is measuring. thanks
    – dr_the_aregentinian
    Dec 8, 2009 at 12:38
  • The command "man elf" will give you more information on object internal format. If it looks involved and complicated, it is.
    – kmarsh
    Dec 8, 2009 at 13:47

1 Answer 1


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy