UnixServerAdmin

Server Administration & Management

Commands

1. # netstat -tulpn | grep :80

2. # fuser 7000/tcp [Find out the processes PID that opened tcp port 7000]

3. # ps ax | grep httpd | wc -l

4. # ps aux | awk ‘{ print $8 ” ” $2 }’ | grep -w Z

5. # netstat -ant | awk ‘{print $NF}’ | grep -vE ‘[:upper:]’| sort | uniq -c | sort -rn

6. # netstat -ntu | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n

7. # wc -l /proc/net/ip_conntrack

8. # history | awk ‘{print $2}’ | sort | uniq -c | sort -rn | head [List the most used commands in your history]

9. # cat /etc/domainusers | wc -l [Main Domain of Server]

10. # /ls /var/named/ | wc -l [Total Domain of Server]

11. # ps aux | awk ‘{print $2, $4, $11}’ | sort -k2rn | head -n 20 [List running processes ordered by RAM usage]

12. # netstat -nap | grep SYN [Synflood Attack]

13. # netstat -nap | grep SYN | wc -l [Synflood Attack]

14. # echo 1 > /proc/sys/vm/drop_caches [Flash RAM Memory]

15. # /bin/sed ‘s/(.*)(: )(.*)/3: 1/’ </etc/domainips | /bin/sort >/etc/domainips_reverse [command to create reverse IP for an domain]

Advertisements

January 13, 2011 - Posted by | Tips & Tricks, Unix/Linux | , ,

2 Comments »

  1. Your knowledge definitely fills a necessity. I have been wanting to find this sort of content and you seriously came through. Can you believe that everything you have written just about exactly replicates my very own experience.

    Comment by filtered water | June 15, 2011 | Reply

  2. Are you clairvoyant? You have to be because your writing so completely fits all the questions I have for this topic. I only entered several phrases in the google search and I’m very pleased that your blog popped up.

    Comment by clean water | June 16, 2011 | Reply


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: