如何获取使用nohup运行的程序列表 [英] How to get a list of programs running with nohup

查看:231
本文介绍了如何获取使用nohup运行的程序列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用SSH连接访问运行CentOS(linux发行版)的服务器。
因为我不能总是保持登录,我使用nohup [command]&运行我的程序。

I am accessing a server running CentOS (linux distribution) with an SSH connection. Since I can't always stay logged in, I use "nohup [command] &" to run my programs.

我找不到如何获得所有我使用nohup的程序的列表。
jobs只有在我注销之前才能工作。之后,如果我再次登录,jobs命令不显示任何内容,但我可以在我的日志文件中看到我的程序仍在运行。

I couldn't find how to get a list of all the programs I started using nohup. "jobs" only works out before I log out. After that, if I log back again, the jobs command shows me nothing, but I can see in my log files that my programs are still running.

要获取我开始使用nohup的所有程序的列表?

Is there a way to get a list of all the programs that I started using "nohup" ?

推荐答案

> $ nohup storm dev-zookeper ,

When I started with $ nohup storm dev-zookeper ,

METHOD1:使用 c $ c>,

METHOD1 : using jobs,

prayagupd@prayagupd:/home/vmfest# jobs -l
[1]+ 11129 Running                 nohup ~/bin/storm/bin/storm dev-zookeeper &

METHOD2: 使用 ps 命令

METHOD2 : using ps command.

$ ps xw
PID  TTY      STAT   TIME COMMAND
1031 tty1     Ss+    0:00 /sbin/getty -8 38400 tty1
10582 ?        S      0:01 [kworker/0:0]
10826 ?        Sl     0:18 java -server -Dstorm.options= -Dstorm.home=/root/bin/storm -Djava.library.path=/usr/local/lib:/opt/local/lib:/usr/lib -Dsto
10853 ?        Ss     0:00 sshd: vmfest [priv] 

TTY列与 => nohup 正在运行的程序。

TTY column with ? => nohup running programs.

说明


  • 与进程相关

  • STAT列=进程的状态

    • S =可中断睡眠(等待事件完成) li>
    • l =是多线程的(使用CLONE_THREAD,与NPTL pthreads类似)

    参考

    $ man ps 搜索 / PROCESS STATE CODES

    这篇关于如何获取使用nohup运行的程序列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆