ctrl-z is the short cut for bg,what's for fg?

Anyone knows this?

link|improve this question

45% accept rate
feedback

2 Answers

crtl+z sends the suspend signal (SIGTSTP). It doesn't place the process in the background.

link|improve this answer
it works as bg while in vim,so I want another short cut to go back to vim instead of typing fg.. – linux Jun 24 '11 at 2:33
5  
Nope, wrong again. Vim is being suspended; that is not the same as running in the background. A suspended job is just that, one that isn't running. bg runs the job, but stdin and stdout are no longer attached to the console. fg attaches a background or suspended job to the console again. – Chris S Jun 24 '11 at 2:34
is there a short cut to attach a suspended job to the console again? – linux Jun 24 '11 at 2:38
Not that I am aware of, though various distributions tend to do whatever they please. – Chris S Jun 24 '11 at 2:45
feedback

You can define your own in $HOME/.inputrc...

# ALT+Z
"\M-z": "fg\n"

...or by adding bind -x's to your .profile/.bashrc.

bind -x '"\M-z"':"fg" # ALT+Z

For more information, see the READLINE section of the bash manpage.

link|improve this answer
just tried,seems not working. – linux Jun 24 '11 at 4:34
Which method did you try? Did you reload the relevant files? (e.g., logging out/back in; starting a new shell; running . .bashrc or . .profile; or pressing CTRL+x CTRL+r for .inputrc if default keybindings haven't been changed) If so, do you get any errors? – Kanji Jun 24 '11 at 20:36
feedback

Your Answer

 
or
required, but never shown

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