/proc/kcore size incorrect ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all...

Probably this is a stupid question, but anyways...

I'm trying to make a script to generate an /etc/motd, and I wanted to
include memory size of the box.

I tried:

	echo $(($(stat -c %s /proc/kcore) / 1024 / 1024)) "Mb"

but it gives 1022 for a 1Gb box.

In fact:

	werewolf:~# ll /proc/kcore
	-r--------  1 root root 1072566272 2005.10.23 23:53 /proc/kcore
	werewolf:~# stat -c %s /proc/kcore
	1072566272

	werewolf:~# echo $((1024*1024*1024))
	1073741824

Why that difference ?

TIA

BTW, any simple method to get the real mem of the box ?

--
J.A. Magallon <jamagallon()able!es>     \               Software is like sex:
werewolf!able!es                         \         It's better when it's free
Mandriva Linux release 2006.1 (Cooker) for i586
Linux 2.6.13-jam9 (gcc 4.0.1 (4.0.1-5mdk for Mandriva Linux release 2006.0))

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux