zoukankan      html  css  js  c++  java
  • linux系统管理

    查看系统的进程

    [weiyuan@weiyuan ~]$ ps aux

    [weiyuan@weiyuan ~]$ ps aux
    USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
    root         1  0.0  0.0   3792  1436 ?        Ss   02:35   0:01 /sbin/init
    root         2  0.0  0.0      0     0 ?        S    02:35   0:00 [kthreadd]
    root         3  0.0  0.0      0     0 ?        S    02:35   0:00 [migration/0]
    root         4  0.0  0.0      0     0 ?        S    02:35   0:00 [ksoftirqd/0]
    root         5  0.0  0.0      0     0 ?        S    02:35   0:00 [migration/0]
    root         6  0.0  0.0      0     0 ?        S    02:35   0:00 [watchdog/0]
    root         7  0.0  0.0      0     0 ?        S    02:35   0:00 [events/0]
    root         8  0.0  0.0      0     0 ?        S    02:35   0:00 [cgroup]
    root         9  0.0  0.0      0     0 ?        S    02:35   0:00 [khelper]
    root        10  0.0  0.0      0     0 ?        S    02:35   0:00 [netns]
    root        11  0.0  0.0      0     0 ?        S    02:35   0:00 [async/mgr]
    root        12  0.0  0.0      0     0 ?        S    02:35   0:00 [pm]
    root        13  0.0  0.0      0     0 ?        S    02:35   0:00 [sync_supers]
    root        14  0.0  0.0      0     0 ?        S    02:35   0:00 [bdi-default]
    root        15  0.0  0.0      0     0 ?        S    02:35   0:00 [kintegrityd/0]
    root        16  0.0  0.0      0     0 ?        S    02:35   0:00 [kblockd/0]
    root        17  0.0  0.0      0     0 ?        S    02:35   0:00 [kacpid]
    root        18  0.0  0.0      0     0 ?        S    02:35   0:00 [kacpi_notify]
    root        19  0.0  0.0      0     0 ?        S    02:35   0:00 [kacpi_hotplug]
    root        20  0.0  0.0      0     0 ?        S    02:35   0:00 [ata_aux]
    root        21  0.0  0.0      0     0 ?        S    02:35   0:00 [ata_sff/0]
    root        22  0.0  0.0      0     0 ?        S    02:35   0:00 [ksuspend_usbd]
    root        23  0.0  0.0      0     0 ?        S    02:35   0:00 [khubd]
    root        24  0.0  0.0      0     0 ?        S    02:35   0:00 [kseriod]
    root        25  0.0  0.0      0     0 ?        S    02:35   0:00 [md/0]
    root        26  0.0  0.0      0     0 ?        S    02:35   0:00 [md_misc/0]
    root        27  0.0  0.0      0     0 ?        S    02:35   0:00 [linkwatch]
    root        28  0.0  0.0      0     0 ?        S    02:35   0:00 [khungtaskd]
    root        29  0.0  0.0      0     0 ?        S    02:35   0:00 [kswapd0]
    root        30  0.0  0.0      0     0 ?        SN   02:35   0:00 [ksmd]
    root        31  0.0  0.0      0     0 ?        S    02:35   0:00 [aio/0]
    root        32  0.0  0.0      0     0 ?        S    02:35   0:00 [crypto/0]
    root        37  0.0  0.0      0     0 ?        S    02:35   0:00 [kthrotld/0]
    root        38  0.0  0.0      0     0 ?        S    02:35   0:00 [pciehpd]
    root        40  0.0  0.0      0     0 ?        S    02:35   0:00 [kpsmoused]
    root        41  0.0  0.0      0     0 ?        S    02:35   0:00 [usbhid_resumer]
    root        72  0.0  0.0      0     0 ?        S    02:35   0:00 [kstriped]
    root       142  0.0  0.0      0     0 ?        S    02:35   0:00 [scsi_eh_0]
    root       143  0.0  0.0      0     0 ?        S    02:35   0:00 [scsi_eh_1]
    root       152  0.0  0.0      0     0 ?        S    02:35   0:00 [mpt_poll_0]
    root       153  0.0  0.0      0     0 ?        S    02:35   0:00 [mpt/0]
    root       154  0.0  0.0      0     0 ?        S    02:35   0:00 [scsi_eh_2]
    root       293  0.0  0.0      0     0 ?        S    02:35   0:00 [kdmflush]
    root       295  0.0  0.0      0     0 ?        S    02:35   0:00 [kdmflush]
    root       312  0.0  0.0      0     0 ?        S    02:35   0:00 [jbd2/dm-0-8]
    root       313  0.0  0.0      0     0 ?        S    02:35   0:00 [ext4-dio-unwrit]
    root       403  0.0  0.0   2912  1212 ?        S<s  02:35   0:00 /sbin/udevd -d
    root       664  0.0  0.0      0     0 ?        S    02:35   0:00 [flush-253:0]
    root       822  0.0  0.0      0     0 ?        S    02:35   0:00 [vmmemctl]
    root       926  0.0  0.0      0     0 ?        S    02:35   0:00 [jbd2/sda1-8]
    root       927  0.0  0.0      0     0 ?        S    02:35   0:00 [ext4-dio-unwrit]
    root      1024  0.0  0.0      0     0 ?        S    02:35   0:00 [kauditd]
    root      1187  0.0  0.0  12932   812 ?        S<sl 02:35   0:00 auditd
    root      1212  0.0  0.0  36164  1580 ?        Sl   02:35   0:00 /sbin/rsyslogd -i /var/run/syslogd.pid -c 5
    rpc       1254  0.0  0.0   2576   796 ?        Ss   02:35   0:00 rpcbind
    root      1361  0.0  0.5  16060 13068 ?        Ss   02:35   0:00 /usr/bin/perl /home/weiyuan/work/webmin-1.801/miniserv.pl /etc/webmin/miniserv.conf
    dbus      1376  0.0  0.0  13736  1456 ?        Ssl  02:35   0:00 dbus-daemon --system

     

    top - 06:15:08 up  3:39,  1 user,  load average: 0.00, 0.00, 0.00
    Tasks: 121 total,   1 running, 120 sleeping,   0 stopped,   0 zombie
    Cpu(s):  0.3%us,  0.3%sy,  0.0%ni, 99.3%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
    Mem:   2247040k total,   403276k used,  1843764k free,    61348k buffers
    Swap:  2392056k total,        0k used,  2392056k free,   197896k cached
    
      PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                
     1796 root      20   0 67800  20m 5680 S  0.0  0.9   0:01.68 Xorg                                                                                   
     1931 gdm       20   0 84884  15m  12m S  0.0  0.7   0:00.50 gdm-simple-gree                                                                        
     1361 root      20   0 16060  12m 1580 S  0.0  0.6   0:00.37 miniserv.pl                                                                            
     1915 gdm       20   0 63632  11m 9532 S  0.0  0.5   0:00.99 gnome-settings-   

     
    [root@weiyuan weiyuan]# ps aux | grep httpd
    root      3078  0.0  0.0   4968  2168 ?        Ss   03:50   0:00 /usr/local/apache2/bin/httpd -k start
    daemon    3079  0.0  0.0 282700  1832 ?        Sl   03:50   0:03 /usr/local/apache2/bin/httpd -k start
    daemon    3080  0.0  0.1 283724  2344 ?        Sl   03:50   0:03 /usr/local/apache2/bin/httpd -k start
    daemon    3081  0.0  0.1 283724  2332 ?        Sl   03:50   0:03 /usr/local/apache2/bin/httpd -k start
    root      5134  0.0  0.0   5980   732 pts/0    S+   06:37   0:00 grep httpd
    [root@weiyuan weiyuan]# kill -9 3078
    [root@weiyuan weiyuan]# ps aux | grep httpd
    daemon    3079  0.0  0.0 282700  1832 ?        Sl   03:50   0:03 /usr/local/apache2/bin/httpd -k start
    daemon    3080  0.0  0.1 283724  2344 ?        Sl   03:50   0:03 /usr/local/apache2/bin/httpd -k start
    daemon    3081  0.0  0.1 283724  2332 ?        Sl   03:50   0:03 /usr/local/apache2/bin/httpd -k start
    root      5136  0.0  0.0   5980   752 pts/0    S+   06:37   0:00 grep httpd
    [root@weiyuan weiyuan]# 

    要杀死全部的进程使用命令

    [root@weiyuan weiyuan]# killall -9 httpd
    [root@weiyuan weiyuan]# ps aux | grep httpd
    root      5148  0.0  0.0   5980   732 pts/0    S+   06:39   0:00 grep httpd
    [root@weiyuan weiyuan]# 

    [root@weiyuan weiyuan]# nohup  service httpd start &
    [1] 5439

    nohup  表示关闭了终端SecureCRT.exe的窗口进程不退出,&表示让进程在后台运行,所以nohup经常和&一起配合使用

     

    读mysql数据引入redis缓存加快读的速度

    缓冲用来加上写入硬盘的数据

    [root@weiyuan weiyuan]# free -m
                 total       used       free     shared    buffers     cached
    Mem:          2194        397       1797          0         60        195
    -/+ buffers/cache:        141       2053
    Swap:         2335          0       2335
    [root@weiyuan weiyuan]# 

     

    [root@weiyuan weiyuan]# chkconfig --list | grep httpd
    httpd           0:关闭  1:关闭  2:启用  3:启用  4:启用  5:启用  6:关闭
    [root@weiyuan weiyuan]# chkconfig --list | grep atd
    atd             0:关闭  1:关闭  2:关闭  3:启用  4:启用  5:启用  6:关闭
    [root@weiyuan weiyuan]# 
    [root@weiyuan weiyuan]# service atd status
    atd (pid  1740) 正在运行...

    系统中默认只存在at.deny文件,该文件默认的内容是null

    [root@weiyuan weiyuan]# cd /etc/at.deny 
    bash: cd: /etc/at.deny: 不是目录

     
  • 相关阅读:
    C++中自定义类2种自增运算的代码实现和区别
    如何使用resty命令行客户端和http rest服务进行交互?| how to install and use resty command line client for interacting with rest services
    C++中如何使用CUDA进行高性能大规模矩阵乘法运算?| cublasSgemm for large matrix multiplication on gpu in C++
    C++中如何使用CUDA自己实现常用的深度学习激活函数?| how to implement deep learning activation kernels with cuda in c++
    caffe和pytorch如何从文件file和流stream中导入模型?| load model from file and stream for caffe and pytorch
    如何在动态链接库dll/so中导出自定义的模板类template class | how to implement a template class with c++ and export in dll/so
    5种智能指针指向数组的方法| 5 methods for c++ shared_ptr point to an array
    nlohmann 最优秀的C++序列化工具库 详细入门教程
    C++ 如何用百行代码实现线程安全的并发队列 | concurrent queue or blocking queue implemented in cpp
    零知识证明初见
  • 原文地址:https://www.cnblogs.com/kebibuluan/p/9069892.html
Copyright © 2011-2022 走看看