crazybill
April 23rd, 2005, 07:14 PM
Finding out system information on Ubuntu Linux
In order to get system navigation, change your login from user to root. On Ubuntu Linux type
$ sudo –s –H
You will be prompted for a password. Type in your password. Now your termimal will change from $ to # and you are in root.
To get our information we will use the head command. The head command displays on the screen the first few lines of the file from which you are obtaining the information. It is convenient because the information you want in these cases are on the first few lines and head displays the information and closes.
To obtain CPU information:
# head /proc/cpuinfo
An example of what you might get is shown below (In this case there is an AMD Atholon 1700 CPU running at 1469.793 MHz):
processor : 0
vendor_id : AuthenticAMD
cpu family : 6
model : 6
model name : AMD Athlon(tm) XP 1700+
stepping : 2
cpu MHz : 1468.793
cache size : 256 KB
fdiv_bug : no
hlt_bug : no
To obtain Linux version and Debian version information
# head /proc/version
Here is a sample display. In this case I had a Ubuntu Linux 5.04 machine --- but the Linux and Debian numbers for that version of Ubuntu is different. Sometimes you want to know what version of Linux and/or Debian you have in order to see if a certain software distribution is compatible.
Linux version 2.6.10-5-386 (buildd@terranova) (gcc version 3.3.5 (Debian 1:3.3.5-8ubuntu2)) #1 Tue Apr 5 12:12:40 UTC 2005
To obtain memory (RAM) information
# head /proc/meminfo
Here is a sample display for a computer with 256 MB of SDRAM
MemTotal: 256812 kB
MemFree: 14944 kB
Buffers: 36772 kB
Cached: 73916 kB
SwapCached: 3708 kB
Active: 141032 kB
Inactive: 46184 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 256812 kB
To obtain partition of your swap space:
# head /proc/swap
Knowing thw swap partition is important when you do upgrades. This sample output shows that the partition is hda5:
Filename Type Size Used Priority
/dev/hda5 partition 499928 20612 -1
To obtain partition sizes:
# head /proc/partitions
This output shows how a 30GB hard drive is divided:
major minor #blocks name
3 0 40021632 hda
3 1 39521632 hda1
3 2 1 hda2
3 5 499936 hda5
254 0 39521632 dm-0
254 1 499936 dm-1
In order to get system navigation, change your login from user to root. On Ubuntu Linux type
$ sudo –s –H
You will be prompted for a password. Type in your password. Now your termimal will change from $ to # and you are in root.
To get our information we will use the head command. The head command displays on the screen the first few lines of the file from which you are obtaining the information. It is convenient because the information you want in these cases are on the first few lines and head displays the information and closes.
To obtain CPU information:
# head /proc/cpuinfo
An example of what you might get is shown below (In this case there is an AMD Atholon 1700 CPU running at 1469.793 MHz):
processor : 0
vendor_id : AuthenticAMD
cpu family : 6
model : 6
model name : AMD Athlon(tm) XP 1700+
stepping : 2
cpu MHz : 1468.793
cache size : 256 KB
fdiv_bug : no
hlt_bug : no
To obtain Linux version and Debian version information
# head /proc/version
Here is a sample display. In this case I had a Ubuntu Linux 5.04 machine --- but the Linux and Debian numbers for that version of Ubuntu is different. Sometimes you want to know what version of Linux and/or Debian you have in order to see if a certain software distribution is compatible.
Linux version 2.6.10-5-386 (buildd@terranova) (gcc version 3.3.5 (Debian 1:3.3.5-8ubuntu2)) #1 Tue Apr 5 12:12:40 UTC 2005
To obtain memory (RAM) information
# head /proc/meminfo
Here is a sample display for a computer with 256 MB of SDRAM
MemTotal: 256812 kB
MemFree: 14944 kB
Buffers: 36772 kB
Cached: 73916 kB
SwapCached: 3708 kB
Active: 141032 kB
Inactive: 46184 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 256812 kB
To obtain partition of your swap space:
# head /proc/swap
Knowing thw swap partition is important when you do upgrades. This sample output shows that the partition is hda5:
Filename Type Size Used Priority
/dev/hda5 partition 499928 20612 -1
To obtain partition sizes:
# head /proc/partitions
This output shows how a 30GB hard drive is divided:
major minor #blocks name
3 0 40021632 hda
3 1 39521632 hda1
3 2 1 hda2
3 5 499936 hda5
254 0 39521632 dm-0
254 1 499936 dm-1