UNIX Final Flashcards

1
Q

UNIX was designed as a multi-user, multi-tasking operating system. T/F?

A

True

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

Which of the following is not a UNIX based operating system?

Question options:

BSD

SunOS

SVR4

MVS

A

MVS

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

A 10Mb and 100Mb connection both transmit individual bits at the same speed, but the 100Mb connection has more _______ than the 10Mb connection.

A

bandwidth

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

Which of the following is not a Linux based operating system?

Question options:

Ubuntu

WNT

SuSE

RedHat

A

WNT

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

Which of the following commands can be used to change the permissions of a file?

Question options:

chmod

chown

ps -ef

ls -l

A

chmod

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

UNIX was created by researchers in AT&T’s Bell Laboratories after they had worked on a project called Multics.

Question options:
True
False

A

True

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

The original term ‘computer’ referred to people, not machines.

Question options:
True
False

A

True

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

Which of the following is not a valid filename?

Question options:

pV_test

zero/one

test.txt

How many times?

A

zero/one

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

When I want to make a new directory I would issue the _____ command.

A

mkdir

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

The first process, PID 1, is always the process called ____.

A

init

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

Which of the following will NOT display the contents of a file?

Question options:

cat

file

more

less

A

file

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

Fill in the blank so that the following command appends (does not overwrite) to an existing file:

$ps aux ___ test.txt

A

> >

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

An option to prevent accidental overwrites of existing file is to set an environment variable using ‘set -o’. Type the name of the variable:

A

noclobber

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

Which of the following files is the special file that will not retain anything written to it, also known as ‘the bit bucket’?

Question options:

/dev/null

/dev/2

/dev/tty

/bin/sh

A

/dev/null

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

Output is sent to standard out - stdout, errors are sent to standard error - stderr.

Question options:
True
False

A

True

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

The ed editor is a line editor than can be exited by typing the letter q.

Question options:
True
False

A

True

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

Which of the following is not a valid mode for vi?

Question options:

command

insert

extended

binary

A

binary

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

The arrow keys can be used in vi to move about in the file. The arrow keys are duplicated by what other keys: ______

A

hjkl

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

The vi command, ____, will write the changes and quit the editor.

A

:wq

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

The ‘i’ command in vi will _____ text in a file.

A

insert

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

Which of the following commands cannot be used to display output?

Question options:

less

cat

tail

cd

A

cd

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

Which of the following commands will redirect errors of a find command to the ‘bit bucket’ - null file?

Question options:

find / -name test -print > /dev/null

find / -name test -print&raquo_space; /dev/null

find / -name test -print > /dev/null/test

find / -name test -print 2> /dev/null

A

find / -name test -print 2> /dev/null

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

The editor, ed, was developed before computer displays and mice were readily avaialble.

Question options:
True
False

A

True

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

UTF-8 can be considered an extension of what other character code set?

Question options:

EBCDIC

FORTRAN

ASCII

ISO 9000

A

ASCII

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Searching for a single digit in grep can be done by placing the range of numbers in square brackets. The following selects any number zero through nine - [0-9]. What is the appropriate POSIX construction for [0-9]? Question options: [[:digit:]] [[digit]] [:digit:] [digit]
[[:digit:]]
26
The command grep stands for Globally search for Regular Expression and Print. Question options: True False
True
27
Which of the following will look for an E or e at the beginning of a line? Question options: '[Ee]' '[^Ee]' '^[Ee]' '[Ee]$'
'^[Ee]'
28
The following will find any sting of three digits preceded by and followed by a space in the file text; grep ' [0-9]\{3\} ' text Question options: True False
True
29
To invert the order of sort which of the following options is used? Question options: - z - i - r - o
-r
30
The cut command option to specify a colon separating fields would be the following: -d : Question options: True False
True
31
The bash shell us the 'Bourne again shell'. Question options: True False
True
32
There are a number of shell scripts that perform interactive shell setup and load user environment variables. Which of the following is not one of them? Question options: ~/.bash_profile ~/.profile /etc/profile /dev/tty
/dev/tty
33
The set options for the bash shell can also be accomplished with the shopt command. Question options: True False
True
34
If the user updates their .profile and wants to 'source' their updates, which of the following commands would they use? Question options: $ set -o ~/.profile $ . ~/.profile $ export PROFILE=~/.profile
$ . ~/.profile
35
Using shopt, the -o option sets the variable, the +o option unsets it. Question options: True False
False
36
A user has aliased the ps command to be the passwd command. To ensure that the ps command in your shell executes as the real ps command, and not the user's aliased passwd command, you can use which of the following in your script? Question options: command ps enable ps ps -ef
command ps
37
Which of the following commands runs a pwd, then an ls -l, then a df -k, and sends the output of all three commands to a file called daily_out? Question options: (pwd;ls -l;df -k) > daily_out pwd+ls -l+df -k > daily_out (pwd|ls -l|df -k) >> daily_out pwd|ls -l|df -k > daily_out
(pwd;ls -l;df -k) > daily_out
38
The command used to set m as the alias of the command less in bash is: alias m=less Question options: True False
True
39
To make a variable available to child processes, the following command is issued in bash: $ _____ VAR=variable
export
40
The logical 'and' and 'or' concepts can be used with commands in bash, the and operator executes the second command if the first suceeds, the or executes the second command if the first fails. Which of the following are the character representations for the logical 'and' and 'or' in bash? Question options: \and\ \or\ && || == != ++ --
&& ||
41
The sed command, by default, overwrites the file it reads. Question options: True False
False
42
The sed command can use almost any delimiter for separating fields. Which of the following is the default delimiter? (Only one correct answer.) Question options: | - the pipe symbol ` - special single quote / - slash
/ - slash
43
Which of the following sed command restrictions will delete lines 5 through the last line of the file? Question options: 1,5d 5,$d 1-4k5-$d
5,$d
44
The sed command supports metacharaters for searching the lines of text sed reads. Question options: True False
True
45
What text string does the '&' represent in the following command: sed -n 's/north/**&**/gp' some_file
north
46
When sed finds the first occurence of Allan on a line what will it replace Allan with given the following sed command: sed -n 's/\(Al\)lan/\1fred/p' some_file
Alfred
47
The -e option in sed allows multiple edits to occur on a line. Question options: True False
True
48
The awk command views the input stream as a collection of records which can be subdivided into fields. Question options: True False
False
49
Which of the following options will allow sed to invoke a sed script from the command line? Question options: - s - i - v - f
-f
50
Which of the following commands will write lines processed by sed into a file based on the pattern match? Question options: sed -n 's/north/west/gp' some_file sed -n '/Bill/r no_bill/' some_file sed -n '/Susan/w myfile' some_file sed -n 's/\(Mar\)got/\1ch/gp' some_file
sed -n '/Susan/w myfile' some_file
51
The following awk if statement will print numbers from 1 to 10 except for number 5, T or F. BEGIN{ x=1; while (x
True
52
What does the following awk segment define? Address[$4] Question options: break mathmatical expression array continuation statement
Array
53
What permission do shell scripts require in order for a user other than the owning user or a member of the owning user's group to use/run them? Question options: write permission for other read permissions for other execute permission for other
execute permission for other
54
Shell scripts consist of of commands, programming constructs, and comments. Question options: True False
True
55
What does the read command do? Question options: Read takes the output array of a specified field in a file that becomes input into an array used by the shell. Read will list a series of variables that the user must read before the script can proceed. Read will take a line from stdin and assign it to a specified variable. Read defines the variables used by the scripting language.
Read will take a line from stdin and assign it to a specified variable.
56
Shell scripts can do complex floating point computations without resorting to the use of other tools. Question options: True False
False
57
There is more than one way to declare an integer value in a shell script. Pick the appropriate methods. Question options: let NUM=6 declare -i NUM;NUM=6 NUM[6]
declare -i NUM;NUM=6
58
Which of the following test expressions is formatted correctly? (Pick one only) Question options: { 0 -eq 0 } [ 0 -eq 0 ] [0 -eq 0] {0 -eq 0}
[ 0 -eq 0 ]
59
True or false, arguments taken into the script from the command line are called positional parameters. Question options: True False
True
60
The awk programming language allows some flexibility in looping. Select which looping controls awk allows from the following list. Question options: for loop break and continue statements while loop
for loop break and continue statements while loop
61
UNIX/Linux has a utility that allows for job scheduling. What is it known as? Question options: chmod chown cd crontab
crontab
62
The null command is represented by a colon, : Question options: True False
True
63
Which of the following are true of the case statement? Question options: must occur at the beginning of any shell uses 'case' and 'esac' to define the boundaries of the case statement can be used as an alternative to if commands uses two semi-colons, ;; , to mark the end of actions
uses 'case' and 'esac' to define the boundaries of the case statement can be used as an alternative to if commands uses two semi-colons, ;; , to mark the end of actions
64
The for loop is used for processing a finite number of items. Question options: True False
True
65
The while loop cannot, by definition, process infintely. Question options: True False
False
66
The until loop continues until a break condition is met. Question options: True False
True
67
Select can be used to do which of the following? (One right choice) Question options: test output created by an if statement format text output create menus
create menus
68
The while loop breaks when what of the following occurs? (One answer only) Question options: user enters correct response exit code is zero the loop reaches 10 iterations exit code is not zero
exit code is not zero
69
The until loop breaks out of the loop when the exit status is zero. Question options: True False
True
70
Which of the following statements is true of break and continue? (One correct answer) Question options: break will only break out of a continue statement break forces an exit from the loop, continue returns control to the top of the loop break and continue do the same thing
break forces an exit from the loop, continue returns control to the top of the loop