Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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... : )

share|improve this question

migrated from Jul 11 '10 at 13:24

This question came from our site for professional and enthusiast programmers.

up vote 7 down vote accepted

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.

share|improve this answer
yes, it's cool, i tried it... it changes a bit my shell, more features than needed... thanks ! – arod Feb 3 '11 at 21:27

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 Section 3.203 Job Control Job ID

share|improve this answer
@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. – Lucas Jones Jul 10 '10 at 19:49
exactly, that's what i'm looking for – siran Jul 10 '10 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 '10 at 19:55
In that case, screen is your friend, my friend. 1up @Dirk. – niry Jul 10 '10 at 19:59
From Windows, use putty as before. Then on the server, launch screen (or, preferably, byobu) and add additional sessions between which you can switch. – Dirk Eddelbuettel Jul 10 '10 at 21:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .