Objective 13 - LPI Linux Essentials Beta Exam

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

1/71

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 3:47 AM on 9/12/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

72 Terms

1
New cards

[013.1] What is the difference between archiving and compression?

Archiving bundles files/directories into one archive; compression reduces data size. tar archives by itself, while gzip/bzip2/xz compress.

2
New cards

[013.1] What does tar stand for historically?

Tape archive.

3
New cards

[013.1] What does tar -c do?

Creates a new tar archive.

4
New cards

[013.1] What does tar -t do?

Lists/views the contents of a tar archive without extracting it.

5
New cards

[013.1] What does tar -x do?

Extracts files from a tar archive.

6
New cards

[013.1] What does tar -f do?

Specifies the archive file to operate on; the archive filename follows the option.

7
New cards

[013.1] What does tar -v do?

Verbose mode: shows file names as tar processes them.

8
New cards

[013.1] What does tar -u do?

Updates an existing uncompressed tar archive by adding/replacing files; the LPI material notes compressed tar archives cannot be updated this way.

9
New cards

[013.1] Interpret: tar -cf backup.tar Documents

Create backup.tar containing the Documents directory and its contents; this creates an archive but does not itself compress it.

10
New cards

[013.1] Interpret: tar -tf backup.tar

List the contents of backup.tar without extracting it.

11
New cards

[013.1] Interpret: tar -xf backup.tar

Extract the contents of backup.tar.

12
New cards

[013.1] Which tar compression options map to gzip, bzip2, and xz?

z = gzip, j = bzip2, J = xz.

13
New cards

[013.1] Interpret: tar -czf backup.tar.gz Documents

Create a tar archive of Documents and compress it with gzip.

14
New cards

[013.1] What do gzip, bzip2, and xz have in common?

They are lossless compression tools; by themselves they compress data but do not create multi-file archives.

15
New cards

[013.1] Which commands decompress gzip, bzip2, and xz files?

gunzip for .gz, bunzip2 for .bz2, and unxz for .xz.

16
New cards

[013.1] How do zip and unzip differ from tar plus gzip/bzip2/xz?

ZIP combines archiving and compression in one format; zip creates ZIP archives and unzip extracts them. For directories, zip -r includes their contents.

17
New cards

[013.2] What are the three standard I/O streams?

Standard input (stdin), standard output (stdout), and standard error (stderr).

18
New cards

[013.2] What numeric file descriptors are normally associated with stdin, stdout, and stderr?

stdin = 0, stdout = 1, stderr = 2.

19
New cards

[013.2] What does > do?

Redirects standard output to a file, creating it if needed and overwriting existing contents.

20
New cards

[013.2] What does >> do?

Redirects standard output to a file and appends instead of overwriting.

21
New cards

[013.2] What does 2> do?

Redirects standard error to a file, overwriting that file's existing contents.

22
New cards

[013.2] What does 2>> do?

Appends standard error to a file.

23
New cards

[013.2] What does < do?

Redirects a file into a command's standard input.

24
New cards

[013.2] What does | do?

Pipes the standard output of the command on the left into the standard input of the command on the right.

25
New cards

[013.2] Interpret: head -n 5 /etc/passwd | sort -r

Take the first 5 lines of /etc/passwd, then pass them to sort for reverse sorting.

26
New cards

[013.2] Interpret: tail -n 9 file.txt | wc -c

Take the last 9 lines of file.txt and count their bytes with wc -c.

27
New cards

[013.2] What does cat mainly do in this objective?

Displays and/or concatenates file contents to standard output.

28
New cards

[013.2] What does less do?

Displays text interactively so you can scroll through it.

29
New cards

[013.2] What do head and tail show by default?

head shows the first 10 lines; tail shows the last 10 lines.

30
New cards

[013.2] What does sort do?

Sorts input lines.

31
New cards

[013.2] What does wc do by default?

Counts lines, words, and bytes; common focused options include -l for lines, -w for words, and -c for bytes.

32
New cards

[013.2] What does cut do?

Extracts selected fields or sections from each input line.

33
New cards

[013.2] [V2 explicit] What does uniq do in normal use?

It filters adjacent duplicate lines; it is commonly paired with sort when you want repeated values grouped before duplicate filtering.

34
New cards

[013.2] Why is sort | uniq a common pattern?

sort groups identical lines next to each other, and uniq can then remove or process those adjacent duplicates.

35
New cards

[013.2] What does grep do?

Searches input/files for lines matching a pattern and outputs matching lines.

36
New cards

[013.2] Why use grep -E?

It enables Extended Regular Expression syntax.

37
New cards

[013.2] In an ERE, what does . mean?

Any single character.

38
New cards

[013.2] In an ERE, what do [abc] or [a-z] mean?

Match one character from the listed set or range.

39
New cards

[013.2] In an ERE, what does * mean?

Zero or more occurrences of the preceding expression.

40
New cards

[013.2] In an ERE, what does ? mean?

Zero or one occurrence of the preceding expression.

41
New cards

[013.3] What is a shebang?

The #! line at the start of a script that specifies which interpreter should execute it.

42
New cards

[013.3] What does #!/bin/bash specify?

Use /bin/bash as the interpreter for the script.

43
New cards

[013.3] How do you normally assign a Bash variable?

name=value with no spaces around =, for example username=Carol.

44
New cards

[013.3] How do you substitute the value of a variable named username?

$username or ${username}.

45
New cards

[013.3] Are Bash variable names case-sensitive?

Yes. username and Username are different variables.

46
New cards

[013.3] What does $1 mean in a shell script?

The first positional argument passed to the script.

47
New cards

[013.3] What do $2 through $9 represent?

Additional positional arguments passed to the script.

48
New cards

[013.3] What does $# contain?

The number of positional arguments passed to the script.

49
New cards

[013.3] What do $@ and $* represent?

All positional arguments passed to the script; the LPI material presents both as holding all script arguments.

50
New cards

[013.3] If ./hello.sh Carol Dave is run, what are $1 and $2?

$1 is Carol and $2 is Dave.

51
New cards

[013.3] What is the basic structure of an if statement used in the LPI material?

if [ condition ]; then commands; else commands; fi — with the test brackets requiring proper spacing.

52
New cards

[013.3] Why do spaces around [ condition ] matter in Bash examples?

[ is parsed as a command/test construct, so missing required spaces can cause syntax/command errors.

53
New cards

[013.3] What does -eq test?

Numeric equality.

54
New cards

[013.3] What does -ne test?

Numeric inequality (not equal).

55
New cards

[013.3] What does -gt test?

Numeric greater-than.

56
New cards

[013.3] What does -ge test?

Numeric greater-than-or-equal.

57
New cards

[013.3] What does -lt test?

Numeric less-than.

58
New cards

[013.3] What does -le test?

Numeric less-than-or-equal.

59
New cards

[013.3] What does == test in the LPI shell-script examples?

String equality, not numeric arithmetic equality.

60
New cards

[013.3] Why can == and -eq produce different results?

NAME?

61
New cards

[013.3] [V2 explicit] What does [ -e $file ] test in Bash?

Whether a filesystem entry exists at the path stored in $file.

62
New cards

[013.3] [V2 explicit] What does [ -f $file ] test in Bash?

Whether the path exists and is a regular file.

63
New cards

[013.3] What does $? contain?

The exit status of the most recently executed command.

64
New cards

[013.3] What exit status normally indicates success?

0.

65
New cards

[013.3] What does a non-zero exit status generally indicate?

Failure or some error/unsuccessful condition.

66
New cards

[013.3] What does exit 0 do inside a script?

Immediately terminates the script and returns status 0 (success).

67
New cards

[013.3] What does exit 1 do inside a script?

Immediately terminates the script and returns status 1, conventionally indicating failure.

68
New cards

[013.3] What happens to commands after an executed exit statement?

They are not run because the script terminates immediately.

69
New cards

[013.3] What is the basic Bash for-loop form?

for item in LIST; do commands using $item; done

70
New cards

[013.3] What does a for loop do with a space-separated list?

Runs the loop body once for each item in the list.

71
New cards

[013.3] How can a for loop iterate over script arguments?

For example: for arg in $@; do echo $arg; done

72
New cards

[013.3] How can a for loop work with a file glob?

The shell expands the glob to matching filenames, then the loop iterates over those names, e.g. for f in *.txt; do echo $f; done.