Shell and Process Invocation Flashcards

(20 cards)

1
Q

What does shell interaction involve?

A

Starting, controlling, and ending sessions.

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

Which commands help manage process invocation and shell behavior?

A

Ctrl+D and exec.

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

What does Ctrl+D do?

A

Signals end of input and closes the session.

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

What does exec do?

A

Replaces the current process with another.

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

What signal does Ctrl+D send?

A

End-of-file (EOF) signal to the shell.

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

What happens when Ctrl+D is pressed?

A

Closes the current shell session gracefully.

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

Does Ctrl+D require typing a command?

A

No, it does not.

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

Example of Ctrl+D usage?

A

Pressing Ctrl+D after finishing tasks logs out and returns to login prompt.

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

What does exec command do?

A

Replaces current shell or process with a new one.

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

Syntax for exec command?

A

exec [command] [arguments].

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

Does exec return to original shell after execution?

A

No, it does not.

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

Example of exec usage for SSH?

A

exec ssh admin@server02 replaces current session with SSH login.

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

Example of exec usage for output redirection?

A

exec > session.log 2>&1 redirects output and errors to session.log.

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

What does ‘exec > session.log 2>&1’ do?

A

Redirects standard output and error to session.log.

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

What happens after exec redirection?

A

Future commands write output and errors to session.log.

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

Will the screen display outputs after exec redirection?

A

No, outputs will no longer display on screen.

17
Q

Why use exec for SSH?

A

To replace the shell with a remote session without returning.

18
Q

Why use exec for redirection?

A

To capture all outputs and errors in a file for logging.

19
Q

What is the overall benefit of exec?

A

Efficiently replace processes and manage session behavior.

20
Q

What is the overall benefit of Ctrl+D?

A

Gracefully end shell sessions without extra commands.