zoukankan      html  css  js  c++  java
  • 笔记:进程(process)与工作(job)

    1. 列出后台工作转台 jobs

    [admin@server3 ~]$ jobs -l
    [1]  15893 Stopped (tty output)   top
    [2]  15897 Stopped (tty output)   top
    [3]  15898 Stopped (tty output)   top
    [4]- 15899 Stopped (tty output)   top
    [5]+ 15900 Stopped (tty output)   top

    2.将job拿到前台处理  fg
    [admin@server3 ~]$ fg %1

    3.将job拿到后台处理 bg
    [admin@server3~]$ bg %3

    4.杀掉进程或job:kill  killall
    [admin@server3 ~]$ kill -9  %2    //杀掉job,job id 前面要加%
    [admin@server3 ~]$ kill -9 15898   //杀掉进程,直接用 PID
    [admin@server3 ~]$ killall -9 java //杀死所有java进程,killall 后面命令名称,而非PID

    5.查看进程 ps
    查看所有进程 : [admin@server3 ~]$ psaux
    杀死JavaAgent: 
    kill -9 `ps aux|grep 'AgentMain'| grep -v 'grep' | awk {' print $2 '}`


    6.动态查看进程变化 top

    7.查看进程树  pstree
    [admin@server3 ~]$ pstree -A | grep java

    8.job到后台执行,参数选项 &
    [admin@server3 ~]$ top &
    [1] 16082
    [admin@server3 ~]$ 

    9.另外还有 pgrep,pkill 等不常用命令



  • 相关阅读:
    9个开源支付项目,用来学习如何实现支付功能
    documentdb
    Azure Redis
    Azure Diagnostics
    Content Delivery Network (CDN)
    MVVM design pattern
    Azure Cloud Application Design and Implementation Guidance performance-optimization
    Azure Nosql
    设计原则与模式
    C# Yield
  • 原文地址:https://www.cnblogs.com/leeeee/p/7276606.html
Copyright © 2011-2022 走看看