Tuesday 1 November 2011

System Process Commands in Linux

TO check the Process id of any application, command etc

[root@localhost ~]# ps -aux

To kill a process normally


[root@localhost ~]# kill <process_id>

ex: -- [root@localhost ~]# kill 2521

To kill the process forcefully use stamp value as '9'
[root@localhost ~]# kill -9 <process_id>

[root@localhost ~]# kill -9 2521

To see the cpu & process status
[root@localhost ~]# top

To see the open port number and service name

[root@localhost ~]# netstat -antp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name
tcp        0      0 127.0.0.1:2208              0.0.0.0:*                   LISTEN      1802/hpiod
tcp        0      0 0.0.0.0:969                 0.0.0.0:*                   LISTEN      1635/rpc.statd
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      1606/portmap
tcp        0      0 127.0.0.1:631               0.0.0.0:*                   LISTEN      1819/cupsd
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      1854/sendmail: acce
tcp        0      0 127.0.0.1:2207              0.0.0.0:*                   LISTEN      1807/python
tcp        0      0 :::22                       :::*                        LISTEN      1833/sshd
tcp        0    148 ::ffff:192.168.10.120:22    ::ffff:192.168.10.114:1401  ESTABLISHED 2411/1


To view how long the system is running

[root@localhost ~]# uptime
 23:34:45 up 23 min,  2 users,  load average: 0.00, 0.02, 0.08

To view Process, Resource and File Systems

[root@localhost ~]# gnome-system-monitor &


To dump the traffic on the network

[root@localhost ~]# tcpdump -i eth0


To display or change Ethernet card settings
[root@localhost ~]# ethtool eth0
Settings for eth0:
        Supported ports: [ MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Advertised auto-negotiation: Yes
        Speed: 100Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 1

0 comments:

Post a Comment

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Affiliate Network Reviews