How to get a list of programs running with nohup
When I started with $ nohup storm dev-zookeper
,
METHOD1 : using jobs
,
prayagupd@prayagupd:/home/vmfest# jobs -l[1]+ 11129 Running nohup ~/bin/storm/bin/storm dev-zookeeper &
METHOD2 : using ps
command.
$ ps xwPID TTY STAT TIME COMMAND1031 tty1 Ss+ 0:00 /sbin/getty -8 38400 tty110582 ? 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 -Dsto10853 ? Ss 0:00 sshd: vmfest [priv]
TTY column with ?
=> nohup
running programs.
Description
- TTY column = the terminal associated with the process
- STAT column = state of a process
- S = interruptible sleep (waiting for an event to complete)
- l = is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)
Reference
$ man ps
# then search /PROCESS STATE CODES
Instead of nohup
, you should use screen
. It achieves the same result - your commands are running "detached". However, you can resume screen sessions and get back into their "hidden" terminal and see recent progress inside that terminal.
screen
has a lot of options. Most often I use these:
To start first screen session or to take over of most recent detached one:
screen -Rd
To detach from current session: Ctrl+ACtrl+D
You can also start multiple screens - read the docs.