View previous topic :: View next topic |
Author |
Message |
doedel Guru
Joined: 05 Feb 2006 Posts: 579 Location: Denmark
|
Posted: Wed Aug 01, 2018 6:48 am Post subject: Necropost: Listing jobs |
|
|
[Moderator note: This post, and the first two responses to it, were originally attached to the 11 year dead [solved] Pausing emerge to allow for cool-down. -Hu]
Sorry for picking up a dead topic, but I have a question on this. Hope it's OK to post here.
Is there a "list command" for suspended jobs? If i suspend more than one job with CTRL-Z, it would be handy to get all the suspended jobs (something like screen -ls but only for suspended jobs). _________________ 1 ha == 1 Hekto-Ar == 1 Hektar |
|
Back to top |
|
|
grumblebear Apprentice
Joined: 26 Feb 2008 Posts: 202
|
Posted: Wed Aug 01, 2018 7:47 am Post subject: |
|
|
doedel wrote: |
Is there a "list command" for suspended jobs? If i suspend more than one job with CTRL-Z, it would be handy to get all the suspended jobs (something like screen -ls but only for suspended jobs). |
That command is unsurprisingly called "jobs". |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Wed Aug 01, 2018 10:27 am Post subject: |
|
|
doedel wrote: | Is there a "list command" for suspended jobs? If i suspend more than one job with CTRL-Z, it would be handy to get all the suspended jobs (something like screen -ls but only for suspended jobs). |
doedel ... as grumblebear pointed out, that command is 'jobs', but not all shells are created equal, with zsh you get tab completion with 'fg' (forground):
Code: | % vim test ; ps aux | less ; watch 'dmesg | tail -n $(( +LINES ? LINES - 4 : 20 ))'
% jobs -l
[1] 29048 suspended vim -p test
[2] - 29049 done ps aux |
29050 suspended less
[3] + 29051 suspended watch 'dmesg | tail -n $(( +LINES ? LINES - 4 : 20 ))'
% fg <TAB>
---- job
%1 -- vim -p test
%2 -- ps aux | less
%3 -- watch 'dmesg | tail -n $(( +LINES ? LINES - 4 : 20 ))' |
You can then tab select, and/or cycle through, job (with '%{n}' or '%{command}' also having tab completion) ... 'cntl-u' to abort/cancel.
best ... khay |
|
Back to top |
|
|
|