Why is the file /bin/false so large?

Loïc Grenié loic.grenie at gmail.com
Tue Feb 9 12:16:39 UTC 2010


2010/2/9 Detlef Lechner <Detlef.Lechner at gmx.net>:
> Hi,
>
> why is the file /bin/false so large (30260 bytes) for providing so
> little functionality (according to 'man false'?

   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.

    You can substitute it with the much smaller

#!/bin/sh
exit 1

  or, for true,

#!/bin/sh
exit 0

  You can also try variants:

#!/bin/sh -c :

  or even

#!/bin/sh

  for true,

#!/usr/bin/[ -z 1 ]

  for false (but it's longer)...

     Loïc




More information about the ubuntu-users mailing list