Linux Administration Analysing Processes Flashcards

1
Q

every program is run as a _______

A

process

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

what is a process

A

instance of a running program

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

command to check the running process

A

ps

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

what does ps -f do ?

A

displays the full information of each process, including the user who owns the process and the command line arguments used to start the process.

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

what does ps -fe do ?

A

It shows all processes running on the system, including those of other users

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

how to show dynamic real-time view of processes and tasks

A

top

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

what exactly does top show

A

PID
PR
SHR
VIRT
USER
%CPU
TIME+
NI
%MEM

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

what is PID

A

Shows task’s unique process id.

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

what is PR

A

Stands for priority of the task.

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

WHAT IS SHR

A

Represents the amount of shared memory used by a task.

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

what is VIRT

A

Total virtual memory used by the task.

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

what is USER

A

User name of owner of task

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

what is %cpu

A

Represents the CPU usage.

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

what is time+

A

CPU Time, the same as ‘TIME’, but reflecting more granularity through hundredths of a second

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

what is NI

A

Represents a Nice Value of task. A Negative nice value implies higher priority, and positive Nice value means lower priority.

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

what is mem%

A

Shows the Memory usage of task.

17
Q

check if the vim or bash process i running

A

ps -fe |egrep “vi|bash”

18
Q

How can you identify conclusively the process ID (PID) for each of the bash shell?

A

ps -fe | grep “bash”

19
Q

what is a job

A

display the status of all the background jobs that are running or stopped in the current shell.

20
Q

how to list all jobs

A

jobs

21
Q

how to start httpd

A

service httpd start

or

systemctl start httpd

22
Q

how to kill process

A

kill [process_id]

kill 12593

23
Q

how to bring process to the foreground

A

fg %[job_number]

24
Q

what are signals

A

Signals are used to notify a process or thread of a particular event.

Signals are software interrupts.

25
Q

what happens when signal is sent to process/thread

A

When a signal is sent to a process or thread, it causes the processor to enter an “interrupt”
handler, so subsequent processing can be done in the operating system based on the source and
cause of the interrupt.

26
Q

command to list the signals to use with the kill command.

A

kill -l

27
Q

Every type of event is represented by a ______

A

signal

28
Q

The system defines a __________ to take when a signal occurs

A

default action

29
Q

what are the 4 types of actions

A

Exit = Forces the process to exit.
Core = Forces the process to exit and create a core file.
Stop = Stops the process.
Ignore = Ignores the signal and no action taken.

30
Q

what does -9 in kill -9 4241 mean ?

A

A signal value of 9 means that the signal cannot be caught by the application but is
intercepted by operating system to terminate the process.

31
Q

what happens if signal is not specified

A

If the signal is not specified, by default, the kill command sends signal 15 to
terminate a process.