LWN.net Logo

My cat is not bigger than my ed

My cat is not bigger than my ed

Posted Aug 27, 2008 3:15 UTC (Wed) by pr1268 (subscriber, #24648)
In reply to: 21 of the Best Free Linux Text Editors (LinuxLinks) by nix
Parent article: 21 of the Best Free Linux Text Editors (LinuxLinks)

me@mybox:~$ ls -l /bin/cat
-rwxr-xr-x 1 root root 17600 2007-06-08 20:12 /bin/cat
me@mybox:~$ ls -l /usr/bin/ed
-rwxr-xr-x 1 root root 37372 2008-04-10 19:58 /usr/bin/ed

It would appear that my cat is smaller than my ed. (Interpret that as you may, but the output above is correct. I'm using Slackware 12.1 with the distro-provided cat and ed. Both binaries are 32-bit ELF LSB x86, stripped.)


(Log in to post comments)

My cat is not bigger than my ed

Posted Aug 27, 2008 4:08 UTC (Wed) by nix (subscriber, #2304) [Link]

That's extremely small. I guess the cat isn't stock coreutils cat, but
something BSD, perhaps?

My cat is not bigger than my ed

Posted Aug 27, 2008 4:38 UTC (Wed) by afalko (subscriber, #37028) [Link]

Yes, you are not alone. My cat is also not bigger than my ed:

andrey@kodiak ~ $ ls -l /bin/cat
-rwxr-xr-x 1 root root 30132 Jul 5 01:53 /bin/cat
andrey@kodiak ~ $ ls -l /bin/ed
-rwxr-xr-x 1 root root 39580 Jul 5 01:58 /bin/ed

I don't know about nix, but I feed by cat organic food. pr1268, you need to start feeding your cat more files :).

My cat is not bigger than my ed

Posted Aug 27, 2008 4:45 UTC (Wed) by pr1268 (subscriber, #24648) [Link]

Hehe, I LOL'ed. But, Slackware's (ver. 12.1) cat is from the GNU Coreutils package. And, I promise, I have not fed the cat anything!

My cat is not bigger than my ed

Posted Aug 27, 2008 5:03 UTC (Wed) by nix (subscriber, #2304) [Link]

I guess I need to hunt some bloat in my cat...

... ah, 34Kb of .text and the rest is assorted rubbish like a debuglink
section, EH frame data, and so on. Much of it is padding.

However, my ed only has 28Kb of text!

FWIW size of ed and cat on Slackware 12.1

Posted Aug 27, 2008 5:26 UTC (Wed) by pr1268 (subscriber, #24648) [Link]

me@mybox:~$ size $(which ed) text data bss dec hex filename 33862 1696 604 36162 8d42 /usr/bin/ed me@mybox:~$ size $(which cat) text data bss dec hex filename 15230 460 356 16046 3eae /usr/bin/cat

Granted, size(1) will read through symlinks, and cat(1) in /usr/bin is symlinked to /bin/cat in Slackware 12.1.

FWIW size of ed and cat on Slackware 12.1

Posted Aug 27, 2008 7:21 UTC (Wed) by nix (subscriber, #2304) [Link]

nix@loki 32 /home/nix% size $(which ed)
text data bss dec hex filename
39263 1696 604 41563 a25b /usr/bin/ed
nix@loki 33 /home/nix% size $(which cat)
text data bss dec hex filename
44371 1984 0 46355 b513 /usr/bin/cat
nix@loki 34 /home/nix% cat --version
cat (GNU coreutils) 6.12
[...]

I still have a little game of hunt-the-fat-cat to play.

(size -A, a GNU extension, gives a much more detailed breakdown.)

My cat is not bigger than my ed

Posted Aug 27, 2008 14:37 UTC (Wed) by tjc (guest, #137) [Link]

> It would appear that my cat is smaller than my ed.

Perhaps you should put that in your .sig file. ;)

Copyright © 2012, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds