PDA

View Full Version : Finding out system information on Ubuntu Linux


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

dewey
April 23rd, 2005, 10:52 PM
Just a spelling correction.
$ sudu –s –H

To "$sudo -s -H"

crazybill
April 23rd, 2005, 11:38 PM
Thanks. I corrected the keyboard error.

magicfab
April 25th, 2005, 12:11 PM
uname -r will also give the version running.

seven
April 25th, 2005, 12:31 PM
you can use lsb-release to find details about your dist
df -H -T will also give info about partitions
and free -m for mem info

Sam
April 25th, 2005, 12:57 PM
Two other typos:
# head/proc/version
# head/proc/meminfo
They should have a space between "head" and the rest of the line.

Another thing, maybe "cat" would be better than "head". Ok, not the infos are useful, but eg. if you have more than 8 partitions you will miss something.

crazybill
April 28th, 2005, 01:05 AM
Thanks. I didn't notice that. I must have been "spacedout"! I edited it with the space in case anyone tries to copy paste .. instead of type.

Concerning head vs cat, I prefer head in general because it puts less in the terminal window (I do most stuff through the network). In most cases that works fine. Of course, if you need to see more, cat is command of choice.

stevenyu
April 28th, 2005, 03:12 AM
for those people running a server (forexample , a LAMP server), you can install lm_sensor and phpsysinfo to find out all youy need to know regarding to the states of your server

fifoKamb3
November 9th, 2009, 01:05 PM
I get this:


administrator@server1:~$ cat /proc/swap
cat: /proc/swap: No such file or directory

lavinog
November 9th, 2009, 06:53 PM
I get this:


administrator@server1:~$ cat /proc/swap
cat: /proc/swap: No such file or directory

try:

cat /proc/swaps