Wednesday, April 5, 2017

How to move a linux process to foreground and background

How to move a linux process to foreground and background

I started a java process (not using &), but i need to move that process to background and foreground.

1. First I stopped the process using CTRL+Z ,
2. I do a process grep and i could see its running, (ps aux|grep java)
3. I issues command "jobs", it return me a job ID.


Example : - In this case job id is : 1
-bash-4.1$ jobs
[1]+ Stopped java -jar


4. Command -bash-4.1$ fg 1 (will bring the job id 1 to foreground)
5. Command -bash-4.1$ bg 1 (will move the job id 1 to background)

No comments:

Post a Comment