Module 2 - 04-3 Flashcards

The shell

1
Q

Define Shell

A

It is the command-line interpreter.

It helps you communicate with the operating system through the command line.
This is essentially the shell.
The shell provides the command-line interface for you to interact with the OS.
To tell the OS what to do, you enter commands into this interface.
The shell communicates with the kernel to execute these commands.

The operating system helps humans and computers speak with each other.
The shell is the part of the OS that allows you to do this.
Think of this as a very helpful language interpreter between you and your system.
Since you do not speak computer language or binary, you can’t directly communicate with your system.
This is where the shell comes in to help you.

Your OS doesn’t need the shell for most of its work, but it is an interface between you and what your system can offer.
It allows you to perform math, run tests, and execute applications.
More importantly, it allows you to combine these operations and connect applications to each other to perform complex and automated tasks.

You can think of a shell as a translator between you and the computer system.
Shells allow you to give commands to the computer and receive responses from it.
When you enter a command into a shell, the shell executes many internal processes to interpret your command, send it to the kernel, and return your results.

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

Define Command

A

An instruction telling the computer to do something

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

What is the purpose of the shell?

  • It instructs the computer to do something.
  • It organizes data.
  • It activates the Linux operating system.
  • It helps humans and computers communicate with each other.
A

It helps humans and computers communicate with each other.

The shell helps humans and computers communicate with each other. It is the command-line interpreter and helps humans communicate with the operating system through the command line.

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

What are some different types of Linux shells (5)?

A
  • Bourne-Again Shell (bash)
  • C Shell (csh)
  • Korn Shell (ksh)
  • Enhanced C shell (tcsh)
  • Z Shell (zsh)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does bash stand for?

A

Bourne-Again Shell (bash)

It uses the dollar sign ($) to indicate where users type in their commands

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

What does csh stand for?

A

C Shell (csh)

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

What does ksh stand for?

A

Korn Shell (ksh)

It uses the dollar sign ($) to indicate where users type in their commands

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

What does tcsh stand for?

A

Enhanced C shell (tcsh)

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

What does zsh stand for?

A

Z Shell (zsh)

It uses the percent sign (%) to indicate where users type in their commands

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

Explain Bash

A

Bash is the default shell in most Linux distributions.
It’s considered a user-friendly shell.
You can use bash for basic Linux commands as well as larger projects.
Bash is also the most popular shell in the cybersecurity profession.

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

What commands can the shell take?

A
  • Standard Input
  • Standard Output
  • Standard Error

Communication with the shell can only go in one of three ways: the system receives a command—this is input; the system responds to the command and produces output; and finally, the system doesn’t know how to respond, resulting in an error.

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

Define Standard input

A

It is the information received by the OS via the command line.

The information is input from your keyboard to the shell.
If the shell can interpret your request, it asks the kernel for the resources it needs to execute the related task.

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

Define Echo

A

A Linux command that outputs a specified string of text

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

Define String data

A

Data consisting of an ordered sequence of characters

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

Define Standard output

A

It is the information returned by the OS through the shell.

Output is a computer’s response to the command you input.
Output is what you receive.

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

Define Standard error

A

It is the error messages returned by the OS through the shell.

The system responds with an error message if they can’t respond to your command.
Sometimes this might occur when we misspell a command or the system doesn’t know the response to the command.
Other times, it might happen because we don’t have the appropriate permissions to perform a command.

17
Q

What can the shell return after a user types a command?

  • Standard output or standard input
  • Standard output only
  • Standard input or standard error
  • Standard output or standard error
A

Standard output or standard error

After a user types a command into the shell, the shell can return either standard output or standard error. Standard output is information returned by the OS through the shell. Standard error contains error messages returned by the OS through the shell.

18
Q

What is the shell?

  • Information received by the operating system (OS) via the command line
  • Data consisting of an ordered sequence of characters
  • The command-line interpreter
  • An instruction telling the computer to do something
A

The command-line interpreter

The shell is the command-line interpreter. It processes commands and outputs the results.

19
Q

After a user inputs a command into the shell, what can the shell return to the user? Select two answers.

  • Output
  • An error message
  • A request for more input from the user
  • A request for user approval
A
  • Output
  • An error message

After a user inputs a command into the shell, the shell can return output or an error message to the user. Output is the computer’s response to the user’s input. An error message occurs when the shell cannot interpret the input.

20
Q

What is standard error in Linux?

  • Information returned by the operating system through the shell
  • Error messages returned by the operating system through the shell
  • Information received by the operating system via the command line
  • A Linux command that outputs a specified string of text
A

Error messages returned by the operating system through the shell

Standard error contains error messages returned by the OS through the shell.

21
Q

What is the difference between standard input and standard output?

  • Standard input is sent from the Filesystem Hierarchy Standard (FHS). Standard output is sent to the FHS.
  • Standard input is sent to the Filesystem Hierarchy Standard (FHS). Standard output is sent from the FHS.
  • Standard input is sent to the operating system. Standard output is sent from the operating system.
  • Standard input is sent from the operating system. Standard output is sent to the operation system.
A

Standard input is sent to the operating system. Standard output is sent from the operating system.