Saturday, November 1, 2014

Processes

1. Open a terminal. This terminal has a process.

2. Type "ping -q 192.168.1.myip". ( you can know your ip from ifconfig ;) )
The ping process will be opened as a child process for the terminal process.
It will be in foreground.
You can not do anything from this terminal till the ping process finishes

3. Now, you can stop the ping process using ctrl+Z. or Kill it using ctrl+C.
Try stopping it using ctrl+Z

4. Type "Jobs" to view all the terminal child processes. Each with its number, and its status (running - stopped - killed - ...etc)

5. You can send the ping process to background or foreground using:
  "bg process_number" or
  "fg process_number"

6. You can open the ping process as a child process to the terminal, directly in the back ground using "ping -q myip &"

7. You can send a signal to kill some process using "kill -9 pid". you can get pid throw "jobs -l"

8. Note that when you close the terminal, its process and all its child processes are killed, including background processes

9. fg vs bg & disown vs nohub
 

No comments:

Post a Comment