I'm working on a hw assignment and was wondering if someone with a bit more Unix experience could explain what is meant by the following question:
Run sample program 1 in the background with &
Using the ps utility with appropriate options, observe and report the PIDs and the status of your processes.
Sample program 1 is:
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
int
main()
{
puts("Before fork");
fork();
sleep(10);
puts("After fork");
}
I compiled and ran:
./fork_demo &
What is the best way to use ps with this running in background? I'm only looking for guidance here and this is a tiny portion of a HW assignment. I've already done the major stuff!