[root@db init.d]# service [service name] (start|stop|restart|status|...)
service name:就是服务名,需与/etc/init.d/目录下面的应用程序对应。
--显示出目前系统上面所有服务的运行状态
[root@db init.d]# service --status-all
acpid (pid 1900) is running...
anacron is stopped
atd (pid 2205) is running...
auditd (pid 1617) is running...
automount (pid 1989) is running...
Avahi daemon is running
Avahi DNS daemon is not running
hcid (pid 1811) is running...
sdpd (pid 1817) is running...
capi not installed - No such file or directory (2)
conmand is stopped
cpuspeed is stopped
crond (pid 2138) is running...
cupsd (pid 2058) is running...
... ...
netstat -[atunlp]
-a 将目前系统上所有的连接、监听、Socket数据都列出来;
-t 列出tcp网络数据包的数据;
-u 列出udp网络数据包的数据;
-n 不列出进程的服务名称,以端口号来显示;
-l 列出目前正在网络坚挺的服务;
-p 列出该网络服务的进程PID。
例如:
[root@linux ~]# netstat -anp | grep 1521
tcp 0 0 0.0.0.0:1521 0.0.0.0:* LISTEN 2542/tnslsnr
tcp 0 0 127.0.0.1:31115 127.0.0.1:1521 ESTABLISHED 2550/ora_pmon_orcl
tcp 0 0 127.0.0.1:1521 127.0.0.1:31115 ESTABLISHED 2542/tnslsnr
[root@linux ~]# netstat -an | grep 1521
tcp 0 0 0.0.0.0:1521 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:31115 127.0.0.1:1521 ESTABLISHED
tcp 0 0 127.0.0.1:1521 127.0.0.1:31115 ESTABLISHED