Module 11 Flashcards
What is a process in an operating system?
A process is a running program with associated information such as Process Identifier (PID), scheduling priority, memory context, file descriptors, and security references.
What are the different process statuses?
- R: Running or ready to run.
- S: Sleeping (waiting for an event).
- T: Traced or stopped.
- D: Non-interruptible sleeping (waiting for I/O).
- Z: Zombie (terminated but not cleaned up).
Which command is used to display information about all running processes?
ps -A or ps -ef.
What does the ps -f command display?
It shows processes in full-format, with detailed information like UID, PID, PPID, CPU usage, start time, and command name.
What does the ps aux command provide?
It displays processes from all users, with user/owner information and processes not started from a terminal.
What is a PID?
Process Identifier, a unique number assigned to each process.
What is a PPID?
The Parent Process Identifier, indicating the parent process of a given process.
What does the CMD column in the ps output represent?
The command that started the process, including its name, options, and arguments.
What is the difference between foreground and background processes?
Foreground processes require user input and run visibly, while background processes do not require user interaction and run in the background.
What command is used to terminate a process using its PID?
kill <PID>.</PID>
What does the killall command do?
Terminates all processes with a specified name.
What is the default signal sent by the kill command?
SIGTERM (signal number 15).
What signal is used for forced termination?
SIGKILL (signal number 9).
What is a Zombie process?
: A terminated process that has not been cleaned up by its parent process.
How do you suspend a foreground job?
Press CTRL+Z.
Which command resumes a suspended job in the background?
bg.
Which command resumes a suspended job in the foreground?
fg.
What does the jobs command display?
A list of all background and suspended jobs.
How do you prioritize processes using niceness values?
By using the nice or renice commands.
What is the syntax to start a process with a specific niceness value?
nice -n <nice_value> <command></command>.</nice_value>
What is the range of niceness values?
From -20 (highest priority) to 19 (lowest priority).
How do you change the niceness value of a running process?
renice <nice_value> -p <PID>.</PID></nice_value>
What does the pgrep command do?
Searches for processes based on their name.
How can you combine ps and grep to find a process?
ps -ef | grep <process_name>.</process_name>
What does the top command do?
Continuously displays real-time information about all processes.
What is the htop command?
An interactive version of top for managing processes.
What does the pidof command do?
Returns the PID of a specified process.
What is a signal in Unix?
A communication tool used to notify processes about events.
Which signal is used to end a session?
SIGHUP (signal number 1).
What does the SIGINT signal do?
Interrupts a process, typically triggered by CTRL+C.
What is the default nice value assigned to processes in Linux?
The default nice value is 0.
What happens when you run find / -name core -exec rm -f {} \; &?
It searches for files named “core” throughout the system and deletes them, running the command in the background.
What does the TIME field in the ps output represent?
It shows the cumulative execution time of the process.
What is a Teletype (TTY) as shown in ps output?
It refers to the controlling terminal of the process.
How do you identify the owner of a process?
By looking at the UID field in the ps output.
What is the purpose of pgrep -u <username> <process_name>?</process_name></username>
Searches for processes owned by a specific user and matches the given process name.
How can you view the status of a specific process using its PID?
Use ps <PID> or ps -p <PID>.</PID></PID>
What are the characteristics of a non-interruptible sleep state (D) in process status?
The process is waiting for I/O operations, such as disk access, and cannot be interrupted.
What does kill -9 <PID> specifically do?</PID>
It forcefully terminates a process by sending the SIGKILL signal, which cannot be ignored.
What happens when a non-root user tries to kill a system process?
The operation is denied because system processes can only be terminated by the root user.
What is the command to kill multiple processes at once using PIDs?
kill <PID1> <PID2> <PID3> or kill -9 <PID1> <PID2> <PID3>.</PID3></PID2></PID1></PID3></PID2></PID1>
What is the function of the renice command?
It modifies the priority (niceness value) of an already running process.
What is the difference between ps aux and ps -ef?
- ps aux includes processes without a terminal and shows the user column.
- ps -ef lists all processes in a full format with additional details like PPID.
What is the fg command used for?
To bring a background or stopped process to the foreground.
What is the bg command used for?
To resume a suspended process in the background.
What does the jobs command show?
It lists background processes and suspended jobs.
Why are Zombie processes problematic?
They consume resources since their termination is not properly handled by the parent process.
What does the SIGFPE signal represent?
A floating-point exception error.