5

Accessing a remote server (Ubunty Hardy) through ssh (putty), i can stop running 'programs' with CTRL-Z (pause signal). I can have multiple paused jobs, which I can see with the command 'jobs'.

The question is regarding if it is possible (or if it already exists) to configure a shortcut to change between processes....

That is, a shortcut equivalent to:

PAUSE current process
fg 'next' (brings to foreground the next stopped application)

The goal is to achieve an equivalent to ALT-TAB via putty... : )

2 Answers 2

7

You would probably benefit from GNU screen (or the byobu variant on Ubuntu) to be able to switch between sessions. That way your other sessions keep running rather than being halted / suspended as you propose here.

1
  • yes, it's cool, i tried it... it changes a bit my shell, more features than needed... thanks !
    – arod
    Feb 3, 2011 at 21:27
4

You can use fg %n where the n is the job id you see in square brackets when using jobs. Also, you can use fg %- for previous job.

See http://www.opengroup.org/onlinepubs/000095399/basedefs/xbd_chap03.html Section 3.203 Job Control Job ID

5
  • @niry: Or just do fg n without the percent. :) Anyway, I think he's asking if you can configure one key to effectively type ^Zfg $(tail jobs | cut -f1 "-d ") or similar. Jul 10, 2010 at 19:49
  • exactly, that's what i'm looking for
    – siran
    Jul 10, 2010 at 19:51
  • i know about "fg n", but im looking if its possible to configure a shortcut to do ^Zfg $(tail jobs | cut -f1 "-d ") or similar
    – siran
    Jul 10, 2010 at 19:55
  • In that case, screen is your friend, my friend. 1up @Dirk.
    – niry
    Jul 10, 2010 at 19:59
  • 1
    From Windows, use putty as before. Then on the server, launch screen (or, preferably, byobu) and add additional sessions between which you can switch. Jul 10, 2010 at 21:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.