2

ls -l /bin/true shows it being 27168 bytes in size, whereas a c program that just returns 0 is much smaller. Also, running objdump -d /bin/true gives a huge assembly program with many system calls. Why is all this needed for a program that just "does nothing successfully"?

  • 2
    true is actually one of the smallest programs of the coreutils package. It has 78 lines of in the source code of which 58 are code, the rest are comments and blank lines. http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=blob_plain;f=src/true.c;hb=HEAD is the source file for true. – jgr208 Oct 25 '16 at 16:34

1 Answers1

5

Because apart from returning 0 it also handles help and version options, plus it contains some comments inside.

You can figure it by yourself by cloning the sources from Github, and looking at the content of coreutils/src/true.c.