ITN 171 Exam 2 (Chapters 4-6)

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/97

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

98 Terms

1
New cards

When you use find, it is useful to note that some UNIX versions require the ____ option after the file name to display the names of files.

-display

-print

-show

-names

-print

2
New cards

When you no longer need a file, you can delete it using the ____ command.

rm

remove

dl

delete

rm

3
New cards

The cp ____ option creates a symbolic link or name at the destination rather than a physical file.

-s

-y

-l

-n

-s

4
New cards

If you execute ____, the contents of file1 are sorted and the results are stored in file2.

sort file1 -o file2

sort file1 -d file2

sort file1 > file2

sort file1 > file2

sort file1 file2

sort file1 > file2

5
New cards

You can use the ____________________ command to associate lines in two files on the basis of a common field in both files.

Join?

6
New cards

The ____ option of the find command displays files that have been changed within the last n minutes.

-min n

-cmin n

-nmin n

-mmin n

-mmin n

7
New cards

The ____ command is used to look for patterns in files.

awk

find

pattern

search

awk

8
New cards

You can use the ____ command to create empty files.

touch

create

make

null

touch

9
New cards

Moving and renaming a file are essentially the same operation.

True

False

True

10
New cards

this option prevents the touch command from creating a file, if it does not already exist

paste

-i

> (gt;)

-t

-u

-d

-r

-c

-name

-c

11
New cards

when deleting a directory with rm, this option is used to recursively delete its files and subdirectories

paste

-i

> (gt;)

-t

-u

-d

-r

-c

-name

-r

12
New cards

option of the cp command that provides a warning before an existing file with the same name is overwritten

paste

-i

> (gt;)

-t

-u

-d

-r

-c

-name

-i

13
New cards

option of the mv command that overwrites a destination file with the same name, if the source file is newer than the one in the destination

paste

-i

> (gt;)

-t

-u

-d

-r

-c

-name

-u

14
New cards

is an option of the find command

paste

-i

> (gt;)

-t

-u

-d

-r

-c

-name

-name

15
New cards

can be used with cat to combine the contents of two files

paste

-i

> (gt;)

-t

-u

-d

-r

-c

-name

> (gt;)

16
New cards

combines files side by side

paste

-i

> (gt;)

-t

-u

-d

-r

-c

-name

paste

17
New cards

option of the cut command used to indicate that a specific character separates the fields

paste

-i

> (gt;)

-t

-u

-d

-r

-c

-name

-d

18
New cards

option of the sort command used to indicate that a specific character separates the fields

paste

-i

> (gt;)

-t

-u

-d

-r

-c

-name

-t

19
New cards

The command rmdir can be used to delete a directory that is not empty.

True

False

False

20
New cards

System administrators and programmers refer to standard output as ____.

sout

stout

stdout

standardout

stdout

21
New cards

When you are moving files, using the -o option with the mv command can be a good idea so that you don't unexpectedly overwrite a destination file with the same name.

True

False

False

22
New cards

The ____ option of the find command displays files that have been changed within the last n days.

-cdays n

-ctime n

-mdays n

-mtime n

-mtime n

23
New cards

UNIX/Linux store data, such as letters, product records, or vendor reports, in flat ASCII files.

True

False

True

24
New cards

To redirect the list of the files in a directory to a file called homedir.list, you enter ____.

ls < homedir.list

ls > homedir.list

homedir.list < ls

homedir.list > ls

ls > homedir.list

25
New cards

When you use cat to combine two files into a third file, the first line of the output contains the first line of the first file followed by the first line of the second file.

True

False

False

26
New cards

To move a file, you use the ____ command along with the source file name and destination name.

rm

rename

mv

move

mv

27
New cards

The ____ option of the paste command is used to specify a different separator as a delimiter.

-t

-o

-d

-s

-d

28
New cards

You can use the ____________________ command to sort a file's contents alphabetically or numerically.

sort

29
New cards

In UNIX/Linux, text files and binary files are considered to be ____ files.

executable

document

regular

dynamic

regular

30
New cards

Character special files are used by input/output devices for communicating one character at a time, providing what is called ____ data.

raw

binary

ASCII

block

raw

31
New cards

The paste command normally sends its output to ____.

stdout

null

stderr

the file indicated as an argument

stdout

32
New cards

When you no longer need a directory, you can use command ____ to remove it.

xtree

rmdir

dldir

deltree

rmdir

33
New cards

A sorting ____ is a field position within each line.

index

key

column

position

key

34
New cards

The join command is used to associate information in two different files on the basis of a common field or ____ in those files.

index

link

column

key

key

35
New cards

The ____ command removes duplicate lines from a file.

grep

dup

uniq

diff

uniq

36
New cards

One way to run a shell script is to make it executable by using the x permission and then typing ____ prior to the script name when you run the script itself.

./

/.

.

..

./

37
New cards

The ____ option of the diff command shows lines surrounding the line that differs.

-d

-D

-c

-C

-c

38
New cards

The ____ redirects the output of one command to the input of another command.

output redirection operator (>)

input redirection operator (<)

pipe operator (|)

tilde (~)

pipe operator (|)

39
New cards

A popular use of pr is to convert lowercase characters to uppercase characters.

True

False

False

40
New cards

The ____ option of the diff command does not compare for blank lines.

-b

-B

-c

-C

-B

41
New cards

1. compares sorted files and shows differences

2. selects lines or rows

3. counts characters, words, or lines in a file

4. selects columns (fields)

5. compares and selects differences in two files

6. formats and prints

7. edits data streams

8. sorts and merges multiple files

9. translates and deletes character by character

Choose from:

comm cut diff grep

pr sed sort tr wc

1. comm

2. grep

3. wc

4. cut

5. diff

6. pr

7. sed

8. sort

9. tr

42
New cards

The ____ command locates identical lines within two identically sorted files.

diff

sed

uniq

comm

comm

43
New cards

The pipe operator can connect several commands on the same command line.

True

False

True

44
New cards

The ____ option of the diff command is used to display the differences side-by-side in columns.

-s

-c

-n

-y

-y

45
New cards

The ____ function within the awk command is used to format output.

out

outln

print

printf

printf

46
New cards

When using wc, you cannot specify all three options (-l, -w and -c) in the command line at the same time.

True

False

False

47
New cards

What is tr used for?

translates and deletes character by character

48
New cards

You can use the less command with a directory to view its contents one screen at a time, such as less /sbin.

True

False

True

49
New cards

You use the ____ command to search for a specified pattern in a file, such as a particular word or phrase.

find

grep

sed

diff

grep

50
New cards

____ is a full-featured programming language.

Sed

Awk

Emacs

Grep

Awk

51
New cards

____ is a selection command.

uniq

awk

sort

sed

uniq

52
New cards

When using the printf function, ____ indicates that the output is to appear in decimal digits.

%i

-i

%d

-d

%d

53
New cards

By default, each page in the output of pr has a ____-line header, which, by default, contains the current file's name, its last modification date, the current page, and a trailer consisting of blank lines.

three

four

five

six

five

54
New cards

By default, pr formats the specified files into single-column pages of ____ lines.

22

33

55

66

66

55
New cards

To append new lines in sed, you must use the ____ command

a\

-a

\a

>a

a\

56
New cards

Bash is a freeware derivative of the Bourne and ____ shells.

Korn

C

csh

tsh

Korn

57
New cards

The ____ option of the diff command ignores blanks that repeat.

-b

-B

-c

-C

-b

58
New cards

The ____ option of the grep command displays only lines that do not contain the search pattern.

-v

-n

-o

-r

-v

59
New cards

You use the ____ character in script files to mark comments.

tilde (~)

dollar ($)

pipe (|)

pound (#)

pound (#)

60
New cards

When you create a shell script to run in Bash, you can immediately run the script by typing ____ and then the name of the script.

run

sh

start

exec

sh

61
New cards

The ____ option of the uniq command instructs it to generate as output only the lines of the source file that are not duplicated successively.

-d

-s

-o

-u

-u

62
New cards

____ is NOT a selection command.

comm

diff

grep

sed

sed

63
New cards

You can use the vi editor to create script files.

True

False

True

64
New cards

Shell scripts run more quickly than compiled programs.

True

False

False

65
New cards

You can use the < operator to redirect a command's output from the screen to a file.

True

False

False

66
New cards

A ____ is a name consisting of letters, numbers, or characters and is used to reference the contents of a variable.

comment

symbolic name

label

tag

symbolic name

67
New cards

When you assign a value to a variable, you might want to evaluate it by displaying its contents via a(n) ____ operator.

definition

echo

evaluating

print

evaluating

68
New cards

The ____ command prints a listing of environment and configuration variables.

printenv

printvar

printf

bash

printenv

69
New cards

The ____ command is useful when you want your shell program to automatically remove any temporary files that are created when the shell script runs.

set

export

tput

trap

trap

70
New cards

Logic structures supported by shell scripts include: sequential logic, decision logic, looping logic, and ____________________ logic.

case?

71
New cards

You should omit spaces when you assign a variable without using single or double quotation marks around its value.

True

False

True

72
New cards

The Bash shell offers improved features over the older Bourne and Korn shells and is fully backward compatible with the Bourne shell.

True

False

True

73
New cards

With no options, ____ displays the current listing of Bash environment and shell script variables.

let

set

sh

export

set

74
New cards

Wildcard characters are also known as ____ characters.

bogus

filler

glob

search

glob

75
New cards

The ____ shell, when compared to the other shells, has a more powerful programming interface.

Bourne

Bash

C

Korn

Bash

76
New cards

A high-level language is a computer language that uses English-like expressions.

True

False

True

77
New cards

____ variables are used to store information about the setup of the operating system, and after they are set up, you typically do not change them.

Global

Environment

Configuration

Shell

Configuration

78
New cards

____ operators compare the relationship between two values or arguments.

Evaluation

Comparison

Logical

Relational

Relational

79
New cards

Shell scripts can automatically access variables created and assigned on the command line.

True

False

False

80
New cards

The ____ statement simplifies the selection of a match when you have a list of choices.

if

switch

case

while

case

81
New cards

The UNIX/Linux shell acts as a(n) ____ when reading script files.

compiler

interpreter

assembler

linker

interpreter

82
New cards

The ____ reads the lines of code that the programmer wrote in the source file and converts them to the appropriate machine-language instructions.

compiler

linker

assembler

interpreter

compiler

83
New cards

____ gives the owner read, write, and execute permissions.

chmod 155

chmod 551

chmod 577

chmod 755

chmod 755

84
New cards

Match each item with a statement below.

1. environment variable that identifies the path name for user's home directory

2. environment variable that holds the path name of the program for the type of shell you are using

3. environment variable that contains the absolute path to the Bash shell, such as /bin/bash

4. environment variable that holds the primary shell prompt

5. environment variable that contains the file name containing commands to initialize the shell

6. environment variable that holds the list of path names for directories searched for executable commands

7. bitwise negation operator

8. logical negation operator

9. matches exactly one character, except for the backslash and period

HOME SHELL BASH

PS1 ENV PATH ~ ! ?

1. HOME

2. SHELL

3. BASH

4. PS1

5. ENV

6. PATH

7. ~

8. !

9. ?

85
New cards

A program's high-level language statements are stored in a file called the ____ file.

shell

script

program

source

source

86
New cards

____ variables are those you create at the command line or in a shell script.

Global

Environment

Configuration

Shell

Shell

87
New cards

The ____ command enables you to initialize the terminal display or terminal window, to place text and prompts in desired locations, and to respond to what the user selects from the menu.

put

tput

clear

tclear

tput

88
New cards

If a source file contains ____ errors, it cannot be converted into an executable file.

syntax

debugging

compilation

logic

syntax

89
New cards

To reference a variable, you use a dollar sign ($) in front of it or enclose it in ____.

square brackets ([ ])

curly brackets ({ })

double quotes (“ ”)

angle brackets (< >)

curly brackets ({ })

90
New cards

You use the chexec command to indicate that a (shell script) file can be executed.

True

False

False

91
New cards

Logic structures are also called ____ structures.

decision

sequential

control

programming

control

92
New cards

The ____ statement continues to loop and execute commands or statements as long as a given condition or set of conditions is true.

for

while

esac

case

while

93
New cards

You can use the ____ operator to redirect commands or program error messages from the screen to a file.

1>

2>

3>

4>

2>

94
New cards

To run the myscript shell script located in the current directory, you should enter: ____.

start myscript

/.myscript

run myscript

./myscript

./myscript

95
New cards

System administrators and programmers refer to standard input as ____.

sin

stint

stdin

standardin

stdin

96
New cards

You can complete a project using awk that you cannot complete using a combination of paste, cut, sort, and join.

True

False

True

97
New cards

When you use the paste command, by default, the pasted results appear in columns separated by commas.

True

False

False

98
New cards

The command > accountsfile ____.

deletes de file accountsfile

is not valid in UNIX/Linux systems

displays the contents of the file accountsfile on the screen

creates an empty file called accountsfile

creates an empty file called accountsfile