Process Management Quiz - Languages Shell
Free practice quiz: Process Management (Languages Shell). 51 multiple-choice questions with answers and explanations. Play online, no sign-up needed.
Play all 51 questions freeSample questions
Which command is used to list all processes currently running on a Linux system, including those owned by other users and those in a defunct state?
- ps aux
- ps -ef
- top
- htop
Show answer
Answer: A. ps aux
`ps aux` is a comprehensive command that displays processes from all users (`a`), processes not associated with a terminal (`x`), and processes in a user-oriented format (`u`). `ps -ef` is similar but uses a different formatting style. `top` and `htop` are interactive process viewers, not static listing commands.
Which signal is typically generated when you press Ctrl+C in a terminal?
- SIGINT
- SIGKILL
- SIGTERM
- SIGQUIT
Show answer
Answer: A. SIGINT
Pressing Ctrl+C in a terminal sends the SIGINT (Interrupt) signal to the foreground process group. This is commonly used to interrupt or terminate a running program. SIGQUIT (Ctrl+\) is similar but typically causes a core dump. SIGTERM is a graceful termination signal, and SIGKILL is a forceful termination signal.
What is the primary mechanism by which a parent process waits for a child process to complete in a shell environment?
- The `wait` command or system call.
- The `sleep` command.
- The `fork` system call.
- Sending a SIGCHLD signal.
Show answer
Answer: A. The `wait` command or system call.
The `wait` command (in shells) or the `wait()` system call (in programming) is used by a parent process to pause its execution until one of its child processes terminates. It also allows the parent to retrieve the exit status of the child. `fork` creates the child, `sleep` pauses execution without regard to children, and SIGCHLD is sent to the parent when a child status changes, but `wait` is the explicit waiting mechanism.
What is the purpose of the `jobs` command in a shell like Bash?
- To list all jobs (processes) currently managed by the shell session.
- To display system-wide running processes.
- To show network connections.
- To monitor CPU usage.
Show answer
Answer: A. To list all jobs (processes) currently managed by the shell session.
The `jobs` command lists the processes that are currently running in the background or have been stopped within the current shell session. It helps manage these jobs (e.g., bringing them to the foreground or resuming them).
Which command allows you to change the priority of a process that is *already running*?
- renice
- nice
- prioritize
- adjust-priority
Show answer
Answer: A. renice
The `renice` command is specifically designed to modify the scheduling priority (niceness) of processes that are already executing. The `nice` command sets the priority when a new process is started.