[Solved] Why is the file /bin/false so large?

Werner Schram wrschram at gmail.com
Tue Feb 9 17:11:26 UTC 2010


On 02/09/2010 05:05 PM, Detlef Lechner wrote:
> Hello Loïc,
>
> On Tue, 2010-02-09 at 13:16 +0100, Loïc Grenié wrote:
>    
>> 2010/2/9 Detlef Lechner<Detlef.Lechner at gmx.net>:
>>      
>    
>>     This is mostly due to the initialization necessary for argument
>>    parsing and environment (even though it is not necessary for true
>>    or false, it is done as for generic programs) and for dynamic
>>    library linking.
>>      
> Thank you very much for your help.
>
> Detlef
>    
Additionally: /bin/false does do argument parsing. It can be called with 
the --version and the --help argument (note that you need to do 
'/bin/false --version' in bash, because false is a built in command).

this is the output of size /bin/false:
    text    data     bss     dec     hex filename
   28406     832     384   29622    73b6 /bin/false

The text segment contains the actual source code, and the data segment 
(mainly) contains the help and version texts. If you do an 'apt-get 
source coreutils' you can see that false (which is defined as true with 
a different return value) does locale settings and uses the printf 
function (which rather big) to print the messages. The existence of 
those messages is probably because of GNU specifications, and the printf 
function seems to be there because of GNU coding standards (all 
coreutils tools use the same messages, and the same method to print them).

Werner





More information about the ubuntu-users mailing list