Study Guide - Chap 21: Optimizing Performance Flashcards

(11 cards)

1
Q

1- What are the three types of option styles available for the ps command? (Choose three.)

  • BSD style
  • Linux style
  • Unix style
  • GNU style
  • Numeric style
A
  • BSD style
  • Unix style
  • GNU style

The GNU ps command in Linux supports parameters that were supported by the legacy BSD and Unix ps command, along with new options created by GNU, so options A, C, and D are correct. There are no Linux style options used by the ps command, so option B is incorrect. The ps command doesn’t support numeric options, so option E is also incorrect.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

2- How do you identify the legacy Unix style options for the ps command?

  • Use a double dash in front of the option.
  • Use a single dash in front of the option.
  • Do not place a dash in front of the option.
  • Unix‐style options are numerical.
  • Unix‐style options use hexadecimal numbers.
A

Use a single dash in front of the option.

The Unix style command‐line options for the GNU ps command are identified by placing a single dash in front of the option, so option B is correct. The newer GNU options are identified by using a double dash, so option A is incorrect. The legacy BSD style options are identified by not placing anything in front of the option letter, so option C is incorrect. Unix style options still use letters, not decimal or hexadecimal numbers, so options D and E are both incorrect.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

3- By default, if you specify no command‐line options, what does the ps command display?

  • All processes running on the terminal
  • All active processes
  • All sleeping processes
  • All processes run by the current shell
  • All processes run by the current user
A

All processes run by the current shell

With no command‐line options, the GNU ps command displays only processes run by the current shell, so option D is correct. To display all processes running on a specific terminal, you need to add the -t option, so option A is incorrect. To display all active processes, you must add the -A option, so option B is incorrect. To display the sleeping processes, you need to use the -ef option, so option C is incorrect. To display all processes run by the current user account, you need to add the -x option, so option E is incorrect.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

4- What top command displays cumulative CPU time instead of relative CPU time?

  • l
  • F
  • r
  • y
  • s
A

s

The S command displays the processes based on the cumulative CPU time for each process, so option E is correct. The l command displays the processes based on the load average, so option A is incorrect. The F command allows you to select the field used to sort the display, so option B is incorrect. The r command reverses the sort order of the display, so option C is incorrect. The y command highlights running tasks, so option D is incorrect.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

6- Shelly thinks that one of the applications on her Linux system is taking up too much physical memory and may have a problem. What column of data from the top display should she focus on?

  • VIRT
  • RES
  • SHR
  • S
  • %MEM
A

RES

The RES column in the top output displays the amount of physical memory used by the applications, so option B is correct. The VIRT column displays the amount of virtual memory, not physical memory, so option A is incorrect. The SHR column displays the amount of shared memory used, so option C is incorrect. The S column displays the status of the application process, so option D is incorrect. The %MEM column displays the percentage of physical memory the application is using but not the amount of physical memory, so option E is incorrect.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

7- Jessica has an application that crunches lots of numbers and uses a lot of system resources. She wants to run the application with a lower priority so that it doesn’t interfere with other applications on the system. What tool should she use to start the application program?

  • renice
  • pkill
  • nice
  • kill
  • pgrep
A

nice

The nice command allows you to specify the priority level for an application, so option C is correct. The renice command allows you to change the priority level of an application that’s already running, but not one that hasn’t started yet, so option A is incorrect. The pkill and kill commands are used to stop running processes, not change their priority levels, so options B and D are incorrect. The pgrep command displays the application processes matching a search term; it doesn’t change the priority level of the processes, so option E is incorrect.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

nice

A

Starts a new process with a specified priority level (nice value), where lower values mean higher priority and higher values mean lower priority.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

renice

A

Changes the priority (nice value) of already running processes, allowing administrators to increase or decrease a process’s CPU scheduling priority.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

pgrep

A

Searches for and displays process IDs (PIDs) of running processes based on name, user, or other criteria, often used with pkill for process management.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

pkill

A

Terminates processes based on their name, user, or other attributes rather than PID, providing a more flexible way to kill multiple matching processes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

kill

A

Sends signals to processes using their PID, most commonly used to terminate processes with SIGTERM (default) or SIGKILL (-9 option).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly