Processes on a Linux System
32 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What is the primary distinction between a program and a process?

  • A program is a running instance of an application, while a process is a file on the hard disk.
  • A program is an executable file on the hard disk, while a process is that executable file running in memory. (correct)
  • A process can exist without a parent process.
  • A program is always stored in the CPU's cache.
  • In process management, what does the term 'PID' refer to?

  • Process Identification Number (correct)
  • Personal ID for user login
  • Process Indicator Device
  • Program Instance Descriptor
  • Which term describes processes that provide essential system and network services and are usually started at system startup?

  • Transient processes
  • Detached processes
  • Daemon processes (correct)
  • User processes
  • What is a child process in relation to its parent process?

    <p>A child process is initiated by a parent process and can also spawn other processes.</p> Signup and view all the answers

    Which term is used to refer to a process that is not associated with a terminal?

    <p>Daemon process</p> Signup and view all the answers

    What does 'PPID' stand for in process management?

    <p>Parent Process Identifier</p> Signup and view all the answers

    When a user starts a process from the terminal, how is that process labeled?

    <p>User process</p> Signup and view all the answers

    What is true about the relationship between parent and child processes?

    <p>Each child process can trace back to a single parent process.</p> Signup and view all the answers

    What does the PPID represent in the output of the ps command?

    <p>Parent Process ID</p> Signup and view all the answers

    What information does the ps --f command primarily provide about each process?

    <p>CPU utilization and process lineage</p> Signup and view all the answers

    Which option can be added to the ps command to include all processes across all terminals?

    <p>--e</p> Signup and view all the answers

    Why are daemon processes not listed in the output of the ps --f command?

    <p>They are not associated with any terminal.</p> Signup and view all the answers

    What is the purpose of using the grep command with the ps command?

    <p>To filter the output for specific information.</p> Signup and view all the answers

    What does the '?' symbol in the TTY column indicate in the process listing?

    <p>The process is a kernel thread or daemon.</p> Signup and view all the answers

    What would the output of the ps command display regarding time if a process ran for less than one second?

    <p>The elapsed time will not be shown.</p> Signup and view all the answers

    Which process typically has a PID of 2 in a Linux environment?

    <p>Kernel Thread Daemon</p> Signup and view all the answers

    What is the PID of the init daemon in a Linux system?

    <p>1</p> Signup and view all the answers

    What represents the Parent Process ID (PPID) of the init daemon?

    <p>0</p> Signup and view all the answers

    Which of the following statements best describes the relationship between processes in Linux?

    <p>Every process can trace back to the init daemon through PPIDs.</p> Signup and view all the answers

    Which command is considered the most versatile for viewing processes in Linux?

    <p>ps</p> Signup and view all the answers

    In a Linux system that uses Systemd for initialization, what will the init process likely appear as?

    <p>systemd</p> Signup and view all the answers

    What is the relationship between Process number 1 and Process number 2?

    <p>Process number 2 has Process number 1 as its parent.</p> Signup and view all the answers

    What does the process state 'R' indicate in the ps command output?

    <p>The process is currently running on the processor.</p> Signup and view all the answers

    Which statement accurately reflects the nature of Linux process IDs (PIDs)?

    <p>PIDs can be reused once a process terminates.</p> Signup and view all the answers

    After logging in to a Linux system, the role of the BASH shell is to:

    <p>Interpret user commands and initiate user processes.</p> Signup and view all the answers

    Which of the following best describes a zombie process?

    <p>A completed process waiting for its parent to release its PID.</p> Signup and view all the answers

    What does the flag 'F' indicate in the output of the ps command?

    <p>The root user started the process.</p> Signup and view all the answers

    Which command is used to view a list of zombie processes in the system?

    <p>ps --el | grep Z</p> Signup and view all the answers

    What does the 'NI' (nice value) affect in a process?

    <p>The way the kernel schedules the process priority.</p> Signup and view all the answers

    How is process priority measured in the Linux kernel?

    <p>Between 0 (high priority) and 127 (low priority).</p> Signup and view all the answers

    What is indicated by a process state of 'D'?

    <p>The process is in an uninterruptible sleep state.</p> Signup and view all the answers

    Which of the following is true about the --l option used with the ps command?

    <p>It provides more information than the --f option.</p> Signup and view all the answers

    Study Notes

    Processes on a Linux System

    • A program is an executable file stored on disk.
    • A process is a program running in memory and on the CPU, essentially a program in action.
    • User processes are programs that run in a terminal, for example: ls, grep, and find.
    • Daemon processes run in the background, typically started at system startup, and provide system services like printing, scheduling, and network services.
    • Every process has a unique Process ID (PID) used by the kernel for identification.
    • Processes can start other processes, known as child processes.
    • Each process has a Parent Process ID (PPID), identifying the process that started it.

    Process Management

    • The init daemon is the first process started by the Linux kernel, with a PID of 1 and a PPID of 0 (referring to the kernel).
    • The init daemon launches most other daemons during system initialization, including those that allow for user logins.
    • After a user logs in, the login program starts a BASH shell, which interprets user commands and starts user processes.
    • The ps command is used to view processes, displaying a list of processes running in the current shell by default.
    • Using the --e option with the ps command shows all processes across terminals and daemons.
    • The --f option with the ps command provides more information about each process, including UID, PPID, STIME, and CPU utilization.
    • The --l option with the ps command displays even more detailed information, including process flags, process state, priority, and nice value.

    Process States

    • The process state (S) column in the ps command output indicates what the process is currently doing.
    • Common states include:
      • S (interruptible sleep): Process is not running on the CPU but is waiting to be awakened by other processes.
      • R (running): Process is currently running on the CPU.
      • D (uninterruptible sleep): Process is waiting for disk access.
      • T (stopped): Process is stopped or being traced by another process.
      • Z (zombie process): Process has finished executing but is waiting for its parent process to release its PID.

    Zombie Processes

    • Zombie processes occur when a process finishes executing but is waiting for its parent process to release its PID.
    • They can accumulate and prevent new processes from being created.
    • Killing the parent process of zombie processes can resolve this issue.

    Process Prioritization

    • Process priority (PRI) is measured between 0 (high priority) and 127 (low priority).
    • Nice value (NI) indirectly affects process priority, measured between -20 (higher chance of high priority) and 19 (higher chance of low priority).

    Studying That Suits You

    Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

    Quiz Team

    Related Documents

    Linux Chapter 9.docx

    Description

    This quiz explores the concepts of programs and processes within a Linux operating system. Learn about user processes, daemon processes, Process IDs (PIDs), and the structure of process management. Understand how the init daemon plays a pivotal role in system initialization.

    More Like This

    Use Quizgecko on...
    Browser
    Browser