SystemdAdmin finals

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/73

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 6:42 AM on 5/27/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

74 Terms

1
New cards

What is Shell Scripting?

Automating command execution using a script instead of typing commands one by one.

2
New cards

What is a Shell?

A command-line interpreter that acts as an interface between the user and the kernel.

3
New cards

What does CLI stand for?

Command-Line Interface.

4
New cards

What does Bash stand for?

Bourne Again Shell.

5
New cards

When was Bash first released?

1989.

6
New cards

What is a Bash script?

A text file (.sh) containing commands executed from top to bottom.

7
New cards

What file extension is commonly used for Bash scripts?

.sh

8
New cards

Name three text editors used to create scripts.

vim, gedit, emacs.

9
New cards

Are Linux filenames case-sensitive?

Yes.

10
New cards

Are john.txt, John.txt, and JOHN.txt the same file?

No, they are different files.

11
New cards

Which characters should be avoided in filenames?

, <, |, :, &

12
New cards

What does #!/bin/sh do?

Starts the shell script.

13
New cards

What symbol is used for comments in Bash?

#

14
New cards

What command displays text on the screen?

echo

15
New cards

What are variables used for?

To store and reuse data in a script.

16
New cards

What is a Local Variable?

A variable available only in the current shell instance.

17
New cards

What is a Shell Variable?

A special variable set by the shell for its operation.

18
New cards

What is an Environment Variable?

A variable available to child processes of the shell.

19
New cards

Which symbol is used for variable assignment?

=

20
New cards

How do you display a variable's value?

Using $ before the variable name.

21
New cards

What shell variable shows the Bash version?

$BASH_VERSION

22
New cards

What does $0 represent?

The filename of the current script.

23
New cards

What does $1 represent?

The first argument passed to the script.

24
New cards

What does $2 represent?

The second argument passed to the script.

25
New cards

What does $n represent?

The nth argument passed to the script.

26
New cards

What does $# represent?

The number of arguments supplied to a script.

27
New cards

What does $* represent?

All arguments as one double-quoted string.

28
New cards

What does $@ represent?

All arguments individually double-quoted.

29
New cards

What does $? represent?

The exit status of the last command executed.

30
New cards

What does $$ represent?

The process ID of the current shell.

31
New cards

What does $! represent?

The process ID of the last background command.

32
New cards

What command is used to get user input?

read

33
New cards

Which arithmetic operator performs addition?

+

34
New cards

Which arithmetic operator performs subtraction?

-

35
New cards

Which arithmetic operator performs multiplication?

*

36
New cards

Which arithmetic operator performs division?

/

37
New cards

Which arithmetic operator returns the remainder?

%

38
New cards

Which operator assigns a value to a variable?

=

39
New cards

Which operator checks equality?

==

40
New cards

Which operator checks inequality?

!=

41
New cards

What Bash command performs arithmetic operations?

let

42
New cards

What is the syntax for let?

let

43
New cards

What does -eq mean?

Equal to.

44
New cards

What does -ne mean?

Not equal to.

45
New cards

What does -gt mean?

Greater than.

46
New cards

What does -lt mean?

Less than.

47
New cards

What does -ge mean?

Greater than or equal to.

48
New cards

What does -le mean?

Less than or equal to.

49
New cards

Which brackets are used in conditional expressions?

[ ]

50
New cards

Why are spaces required inside [ ]?

Because Bash syntax requires spaces around expressions.

51
New cards

Which statement is used for decision-making in Bash?

if statement.

52
New cards

What keyword starts an if statement?

if

53
New cards

What keyword follows the condition in an if statement?

then

54
New cards

What keyword is used for the alternative condition?

else

55
New cards

What keyword ends an if statement?

fi

56
New cards

What is the purpose of a case statement?

To replace multiple if-then-else statements.

57
New cards

Which keyword starts a case statement?

case

58
New cards

Which keyword ends a case statement?

esac

59
New cards

What symbol creates a case option?

)

60
New cards

What symbol ends a case condition?

;;

61
New cards

What symbol represents the default option in a case statement?

*)

62
New cards

What is a loop?

A structure that repeats commands until a condition is met.

63
New cards

Which loop is used when iterating through a list of items?

for loop.

64
New cards

What are the reserved words for a for loop?

for, in, do, done.

65
New cards

Which loop runs while a condition is true?

while loop.

66
New cards

What are the reserved words for a while loop?

while, do, done.

67
New cards

Which loop runs until a condition becomes true?

until loop.

68
New cards

What are the reserved words for an until loop?

until, do, done.

69
New cards

What is the main purpose of shell scripting?

Automation of tasks and command execution.

70
New cards

What command outputs both text and variable values?

echo

71
New cards

What is the first line usually found in a shell script?

!/bin/sh

72
New cards

What is the default option in a case statement used for?

When no other cases match.

73
New cards

What happens when a while loop condition becomes false?

The loop stops executing.

74
New cards

What happens when an until loop condition becomes true?

The loop stops executing.