Playing the commands fg , ctrl+z , bg and jobs In this post I would like to share few basic process or job specific tricks in UNIX. 1. If you want to run a process in bacground just add a & as suffix with a space Eg: [root@localhost kannan]# ruby test.rb & here this process test.rb will run in background 2. If you want list available background tasks/processes/jobs , just use the command 'jobs' Eg: [root@localhost kannan]# jobs here the result would be [1]+ Running ruby test.rb 3. If you want to bring a background process in front (foreground) just use fg [#<job number>] Eg [root@localhost kannan]# fg #1 It will bring the above 'ruby test.rb' process in front. 4. If you want to again move a already running process to background , use two combination of commands a. First pass Ctrl+Z , here you will get a message like 'stopped' don't get upset, it will just suspend
All of the post under this topic will be useful to the developers who are working in Rails with various UNIX/Linux servers