Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

Anyone knows this?

share|improve this question

2 Answers 2

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

share|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
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

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

"\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.

share|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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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