Skip to main content
Chemistry LibreTexts

3: Process Management

  • Page ID
    414587
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    What is a process?

    A process is the execution of a program. Processes are launched by opening an application or when executing a command on the terminal. 

    More than one process can be run by one application, for different tasks. A web navigator, for example, will start a new process each time a new tab is opened.

    In this section, we will learn how to display and manipulate processes.

     

    Listing Running processes

    To display the currently running processes, use the command:

    • ps : process status: produces a snapshot of the running processes.
    ps
    
    Output:

    clipboard_e8415cc486999dae1852130d52ff35c79.png

    The output contains a list of the running processes under 4 columns:

    - PID: the process identification number

    - TTY: the terminal name

    - TIME: the running time

    - CMD: the name of the command that launches the process

    Options that can be used with the ps command:

    • ps -a : lists all the running processes of all the users
    • ps -u : lists additional information (memory usage, CPU usage percentage, process state code, and process owner)

     

    Resource-usage of processes

    To list processes that are consuming the largest amount of resources, use the command:

    • top
    top
    
    Output:

    clipboard_e43eec1706420eb5bb0da152da3d03133.png

    Note

    Unlike the ps command, the top command output updates periodically; You will see real-time updates for running times and CPU usage.

    The output of the top command is a shell that allows the user to move through processes and interact with them. 

    Interacting with a process is done by the keys:

    • k : kills the process
    • M : sorts the list by memory usage
    • N : sorts the list by the process identification numbers
    • r : changes the priority of the process
    • d : changes the refresh time interval
    • c : displays the path of the process

     


    This page titled 3: Process Management is shared under a not declared license and was authored, remixed, and/or curated by Robert Belford.

    • Was this article helpful?