Professional Documents
Culture Documents
SYSTEM PERFORMANCE
The commands discussed below are some of the
most basic commands when it comes to checking and
monitoring system performance including the utilization
of the hard disk,memory or RAM,CPU,the running
processes and the network traffic.
Syntax:
#top
The top command used to display all the running and
active real-time processes in ordered list and updates it
regularly. It display CPU usage, Memory usage, Swap
Memory,
Cache Size, Buffer Size, Process PID, User,
Commands and much more. It also shows high memory
and cpu utilization of a running processes. The top
command is much useful for system administrator to
monitor and take correct action when required
ps - Displays The Processes
who
The easiest way to see who is on the system is to do a
who or w. The who is a simple tool that lists out who is
logged on the system and what port or terminal they are
logged on at.
w - Find Out Who Is Logged on And What They Are
Doing
w command displays information about the users
currently on the machine, and their processes.
# w username
OPTIONS
-h :Don't print the header.
-s :Use the short format. Don't print the login time,
JCPU or PCPU times.
-V :Display version information.
user :Show information about the specified user only
options:
-a : include dummy file systems
UNAME:
Print name of current system. Get name and information
about current kernel.
Syntax:
uname [-a] [-i] [-m] [-n] [-p] [-r] [-s] [-v] [-X] [-S
systemname]
Print basic information currently available
-a from the system.
Print the name of the hardware
-i implementation (platform).
Print the machine hardware name (class). Use
-m of this option is discouraged;
use uname -p instead.
Print the nodename (the nodename is the name
-n by which the system is
known to a communications network).
-p Print the current host's ISA or processor type.
-r Print the operating system release level.
Print the name of the operating system. This is
-s the default.
-v Print the operating system version.
Print expanded system information, one
-X information
element per line, as expected by SCO Unix.
The
displayed information includes:
system name, node, release, version,
machine, and number of CPUs.
Examples
Uname -arv
List the basic system information, OS release, and OS
version as shown below.
SunOS hope 5.7 Generic_106541-08 sun4m sparc
SUNW,SPARCstation-10
Uname -p
Display the Linux platform.
5 uname Examples
1. A basic example
By default the uname command prints just the kernel
name.
For example :
$ uname
Output: Linux
2. Get the kernel name using -s option
Through -s option too, the name of the kernel can be
displayed in output.
For example :
$ uname -s
Output: Linux
3. Get the network node host name using -n option
Name of your host as a network node can be displayed in
output through -n option.
For example :
$ uname -n
Output: himanshu-laptop
4. Get kernel release information using the -r option
For example :
$ uname -r
Output: 2.6.32-21-generic5. Get maximum
information through -a option
For example :
$ uname –a
HOSTNAME:
USERS
/etc/passwd file contains one line for each user
account, with seven fields delimited by colons. This is a
text file. You can easily list users using the cat
command as follows:
$ cat /etc/passwd
a] $USER - Current user name.
KERNEL
The Linux kernel is the operating system kernel used by
the Linux family of Unix-like operating systems. It is a
prominent example of free and open source software.
The Linux kernel is released under the GNU General
Public License version 2 (GPLv2) (plus some firmware
images with various non-free licenses), and is developed
by contributors worldwide. Linux rapidly accumulated
developers and users who adapted code from other free
software projects for use with the new operating system.
The Linux kernel has received contributions from
thousands of programmers. All Linux distributions
released have been based upon the Linux kernel. Kernel
abstracts the hardware to the upper layers. The kernel
presents the same view of hardware even if the underlying
hardware is different. It mediates and controls access to
system resources.
Kernel is hart of Linux O/S. It manages resource of Linux
O/S. Resources means facilities available in Linux. For eg.
Facility to store data, print data on printer, memory, file
management etc . Kernel decides who will use this
resource, for how long and when. It runs your programs (or
set up to execute binary files) It's Memory resident portion
of Linux. It performance following task:-
l I/O management
l Process management
l Device management
l File
management
l Memory management
The heart of the linux system is called kernel. The kernel
provides the interface between you (and the program you
run) and the hardware(hard disks, RAM, network cards
etc).Using the /proc file system, you can find out a lot of
information about your kernel, by simply displaying the
content of /proc file.
Cpuinfo: Tells you the type of CPU in your computer, the
speed, the CPU family and other information related to
your computer‘s processor.
Devices: Displays the character and block devices
currently being used on your computer along with their
major device numbers.
ioports: Shows the I/O port addresses for the devices on
your computer.
Meminfo: Contains information about memory usage and
swap space usage. You can see the total amounts of
memory and the how much is currently being used.
Modules: Shows a list of modules that are currently
installed in the system
Mounts: Displays the file systems that are currently
mounted in the system.
Partitions: Partition related information.
Pci: Lists the PCI devices.
Swaps: Shows the swap partition that are currently
mounted on your system. Net/dev: Displays content
of net/dev file to see your active network interfaces.