To get the list of username with its user ID in formatted way:
Find the particular string from the list of files in current directory:awk -F":" '{ print "username: " $1 "\t\tuid:" $3 }' /etc/passwd
Orcd /etc
for i in $(find -type f); do grep -iH nfsnobody $i; done
Get the number of occurrences of particular word in file:grep -iH nfsnobody *
To delete resources of semaphore arrays from memory:awk '/ServerName/ {i=i+1} END {print i}' /etc/httpd/conf/httpd.conf
grep ServerName /etc/httpd/conf/httpd.conf
ipcs -s | grep apache | perl -e 'while (<STDIN>) { @a=split(/\s+/); print`ipcrm sem $a[1]`}'
To get the list of IP addresses in the server:
Find list of IP address along with eth device and network mask:ifconfig | grep -vw inet6 | grep -w inet | cut -d : -f 2 | cut -d \ -f 1
Know the performance of your HardDisk:ifconfig | cut -d " " -f1,12,16 | grep -A 1 eth | tr -d - | tr -s "\n" |sed -e :a -e N -e 's/\n/ /'
change the device address as per your servers configuration
The details of the present http connections can be found by using:hdparm -Tt /dev/sda
Number of connection from perticular IP address:netstat -plan | grep ":80 " | awk {'print $5'} |awk -F: {'print $1'}|sort
cat /proc/net/ip_conntrack | grep "port=80" | wc -l
Only get the listing of directories:netstat -ntu | awk '{print $5}'| cut -d: -f1 | sort | uniq -c | sort -nr | more
Real Time Network Activity Examples:ls -F $1 | grep \/ | sed -e 's/\/$/4/g'
watch -d "netstat -nalp |grep -v DGRAM |grep -v STREAM |grep -v LISTEN"
watch "netstat -nalp"|grep ":TCP PORT Number"
watch "netstat -nalp"|grep ":22"






Reply With Quote
Bookmarks