\begin{exe} {Processes}

   \begin{enumerate}
      \item
      Run \textbf{ps} with the options \verb?-ef?.  Then
      run it again with the options \verb?aux?.  Note the
      differences in the output.
      \item Run \textbf{ps} so that only the process ID,
      priority, nice value, and the process command line
      are displayed.
      \item
      Start a new \textbf{bash} session by typing
      \textbf{bash} at the command line. Start another
      \textbf{bash} session using the \textbf{nice} command
      but this time giving it a nice value of \verb?10?.
      \item
      Run \textbf{ps} as in step 2 to note the differences
      in priority and nice values. Note the process ID of
      the two \textbf{bash} sessions.
      \item
      Change the nice value of one of the \textbf{bash}
      sessions to 15 using \textbf{renice}.
      Once again, observe the change in priority and nice values.
      \item
      Run \textbf{top} and watch the output as it changes.
      Hit \verb?q? to stop the program.
   \end{enumerate}
   \begin{sol}

      \begin{enumerate}
         \item
         \begin{cmd}
$ ps -ef
$ ps aux
         \end{cmd}

         \item
         \begin{cmd}
$ ps -o pid,pri,ni,cmd
         \end{cmd}
         \begin{response}
  PID PRI  NI CMD
 2389  19   0 bash
22079  19   0 ps -o pid,pri,ni,cmd
         \end{response}
         (Note: There should be no spaces between parameters.)

         \item
         \begin{cmd}
$ bash
$ nice -n 10 bash
$ ps -o pid,pri,ni,cmd
         \end{cmd}
         \begin{response}
 2389  19   0 bash
22115  19   0 bash
22171   9  10 bash
22227   9  10 ps -o pid,pri,ni,cmd
         \end{response}
         \item
         \begin{cmd}
$ renice 15 -p 22171
$ ps -o pid,pri,ni,cmd
         \end{cmd}
         \begin{response}
  PID PRI  NI CMD
 2389  19   0 bash
22115  19   0 bash
22171   4  15 bash
22246   4  15 ps -o pid,pri,ni,cmd
         \end{response}
         \item
         \begin{cmd}
$ top
         \end{cmd}
      \end{enumerate}
   \end{sol}

\end{exe}

