标签归档:linux技巧

Linux中如何查询进程和结束进程呢?


摘要:
下文讲述linux操作系统中查询和关闭进程的方法分享,如下所示;

实现思路:
    1.查询进程
      ps -ef|grep 进程名称

    2.关闭进程
      kill [参数][进程号]       

例:
Linux查询nginx进程并关闭示例分享


[root@******** ~]# ps -ef|grep nginx
root     20555 20537  0 21:57 pts/1    00:00:00 grep nginx
root     20691     1  0 Oct13 ?        00:00:00 nginx: master process ./nginx
nobody   20692 20691  0 Oct13 ?        00:05:05 nginx: worker process
[root@******** ~]# kill 20691;                                                                                      

linux操作系统下如何查看操作系统中所有已启动的系统服务呢?


摘要:
下文讲述linux操作系统中查看所有已启动的系统服务的方法说明,如下所示;

实现思路: 
     使用命令chkconfig --list|grep on 即可列出已启动的系统服务
     (注意是双中杠)

例:
查看当前操作系统中所有已启动的系统服务

[root@iZ23ji6c7snZ ~]# chkconfig --list|grep on
aegis           0:off   1:off   2:on    3:on    4:on    5:on    6:off
blk-availability        0:off   1:on    2:off   3:off   4:off   5:off   6:off
cpuspeed        0:off   1:on    2:off   3:off   4:off   5:off   6:off
crond           0:off   1:off   2:on    3:on    4:on    5:on    6:off
haldaemon       0:off   1:off   2:off   3:off   4:off   5:off   6:off
lvm2-monitor    0:off   1:on    2:off   3:off   4:off   5:off   6:off
mdmonitor       0:off   1:off   2:off   3:off   4:off   5:off   6:off
mysqld          0:off   1:off   2:off   3:on    4:off   5:off   6:off
netconsole      0:off   1:off   2:off   3:off   4:off   5:off   6:off
network         0:off   1:off   2:on    3:on    4:on    5:on    6:off
nscd            0:off   1:off   2:on    3:on    4:on    5:on    6:off
ntpd            0:off   1:off   2:on    3:on    4:on    5:on    6:off
restorecond     0:off   1:off   2:off   3:off   4:off   5:off   6:off
rsyslog         0:off   1:off   2:on    3:on    4:on    5:on    6:off
sshd            0:off   1:off   2:on    3:on    4:on    5:on    6:off
sysstat         0:off   1:on    2:on    3:on    4:on    5:on    6:off
udev-post       0:off   1:on    2:on    3:on    4:on    5:on    6:off

linux操作系统下如何查看操作系统中所有系统服务呢?


摘要:
下文讲述linux操作系统中查看所有系统服务的方法说明,如下所示;

实现思路: 
     使用命令chkconfig --list 即可列出系统服务
     (注意list前面是双中杠)

例:
查看当前操作系统中所有系统服务

[root@iZ23ji6c7snZ ~]# chkconfig --list
abrt-ccpp       0:off   1:off   2:off   3:off   4:off   5:off   6:off
abrtd           0:off   1:off   2:off   3:off   4:off   5:off   6:off
acpid           0:off   1:off   2:off   3:off   4:off   5:off   6:off
aegis           0:off   1:off   2:on    3:on    4:on    5:on    6:off
atd             0:off   1:off   2:off   3:off   4:off   5:off   6:off
auditd          0:off   1:off   2:off   3:off   4:off   5:off   6:off
blk-availability        0:off   1:on    2:off   3:off   4:off   5:off   6:off
cpuspeed        0:off   1:on    2:off   3:off   4:off   5:off   6:off
crond           0:off   1:off   2:on    3:on    4:on    5:on    6:off
haldaemon       0:off   1:off   2:off   3:off   4:off   5:off   6:off