|
Good example.
When you use a command like grep or find, they kick off subprocesses (children processes) that actually do the work.
EXAMPLE #1
The parent ( the command that you typed.) "find . -name somefile -print " kicks off subprocesses that actually go out and search for the file that you specified. When they are done they report back to the find command.
EXAMPLE #2
Using grep if you are trying to do something like matching a pattern(s) in a file to print out the lines.
cat filename|grep patterna
This command will actually spawn 2 processes. The cat command, the parent, and the grep command, the child. When the child (grep) finishes it returns to the parent (cat) with the result.
Example #3
Do a ps -aef |grep sh" to find your telnet session. Find your login and do a ps -aef |grep on that PID. All of your commands are technically children of your telnet session as you will see.
__________________
My brain is your brain
|