Sunday, May 10, 2015

Basic System Monitoring Tools in CentOS / RHEL

To list all processes:
$ ps ax
To show the owner alongside each process:
$ ps aux
To show all processes dynamically:
$ top
or
$ gnome-system-monitor
Display the amount of free and used memory on the system
# free
lsblk allows you to display a list of all block devices:
$ lsblk

As you see lsblk displays the device name (NAME), major and minor device number (MAJ:MIN), if the device is removable (RM), the size of the device (SIZE), if the device is read only (RO), the type of device (TYPE) and the mount point (MOUNTPOINT)

And to see block device id and filesystem:

# blkid


findmnt helps you to display a list of currently mounted file systems:
$ findmnt

As you see findmnt displays the target mount point (TARGET), source device (SOURCE), file system type (FSTYPE), and mount options (OPTIONS).

You can filter the output to show just xfs filesystems: 

$ findmnt -t xfs
To display a detailed report on the system's disk space usage:
$ df -h
To show disk usage for each of the subdirectories in the present working directory:
$ du -h
To display information about PCI devices on your system: 
# lspci
And to get more information: 
# lspci -v
To display information about USB devices:
# lsusb
Again you can get more info by using -v switch. 

To list information about CPU(s):
$ lscpu