Call us: 1-347-414-9117

Introduction

This document will cover some of the basic system administration commands used in Linux to display statistics & information on the installed hardware. These should all be performed as the root user via SSH.

 

 

Commands

$ fdisk -l


Disk /dev/sda: 160.0 GB, 160041885696 bytes

255 heads, 63 sectors/track, 19457 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk identifier: 0x08ae08ad


Device Boot Start End Blocks Id System

/dev/sda1 1 243 1951866 82 Linux swap / Solaris

/dev/sda2 244 19457 154336455 83 Linux

 

The above command will show all the hard drives detected by Linux and their partition tables, partition sizes, and partition IDs with labels. It is particularly useful to see how many hard drives are installed in a system and how they are partitioned.

 

$ cat /proc/cpuinfo

This command will display information about the CPU(s) installed in the system.

 

$ free -m
total used free shared buffers cached
Mem: 1010 338 671 0 128 167
-/+ buffers/cache: 43 967
Swap: 1906 0 1906

This command will show the free / total RAM installed in the system.

 

$ ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:e0:4d:3b:3d:55
inet addr:207.228.225.112 Bcast:207.228.225.255 Mask:255.255.255.0
inet6 addr: fe80::2e0:4dff:fe3b:3d55/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:12500471 errors:0 dropped:0 overruns:0 frame:0
TX packets:13425062 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1851459983 (1.7 GiB) TX bytes:1853340624 (1.7 GiB)
Interrupt:23 Base address:0xe800

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)


The above command will output statistics on the different network interfaces installed in the system.

 

 

$ netstat -an

This commands output has been removed since it is lengthy but it will show a list of all connections made to/from the system.

 

 

 

Conclusion

This is not meant to be an exhaustive guide, but it has some of the useful basic commands for evaluating a Linux system.