Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Necropost: Listing jobs
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
doedel
Guru
Guru


Joined: 05 Feb 2006
Posts: 579
Location: Denmark

PostPosted: Wed Aug 01, 2018 6:48 am    Post subject: Necropost: Listing jobs Reply with quote

[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
View user's profile Send private message
grumblebear
Tux's lil' helper
Tux's lil' helper


Joined: 26 Feb 2008
Posts: 141

PostPosted: Wed Aug 01, 2018 7:47 am    Post subject: Reply with quote

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
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Wed Aug 01, 2018 10:27 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum