Monthly Archives: September 2013

How to find the max inode using folder in server in linux ?

Inodes are the important feature on any server which can sometimes be overused by clients in shared hostingTo find the user or folder using max inodes ,

SSH to server as root

#cd /home     ; Change directory to /home

run below command to see the max using inode account

This will show the max inode folder and then can login to the folder and run below command to see the exact folder which is using max inode

for d in *; do echo -n “$d: “; find $d -type f | wc -l; done

Find Brand of Hard disk in Linux server

Want to fine the find the band name or serial number of the hard disk in Linux sever ?           You just need one package called  hdparm which can be installed using below command

#yum -y install hdparm                                                                                                                  To check hard disk specification run below command

# hdparm -I /dev/sda

Below is the result shown
/dev/sda:

ATA device, with non-removable media
Model Number:       ST1000DM003-9YN162
Serial Number:      S1D55TYB
Firmware Revision:  CC4H
Transport:          Serial, SATA Rev 3.0

Fine spammer account in cpanel server

Getting sick of spammers in server and IP blacklisting ?  To find the spammer account in server you need to SSH to server and run below command

awk ‘$3 ~ /^cwd/{print $3}’ /var/log/exim_mainlog | sort | uniq -c | sed “s|^ *||g” | sort -nr

This will show the the path of the user account from where max email was sent  in sorted order.

You can suspended the user and also check if any malicious file in the directory shown.