DCOM 142 FINAL QUESTIONS & ANSWERS
Which keystrokes invoke the pico or nano search function? - Answers -F6
Ctrl-W
Three keystrokes that can initiate a search-and-replace operation in nano are F14, , and
. - Answers -Ctrl+\
Esc+R
For which type of file is nano least likely to be useful for examining or editing? -
Answers -A LibreOffice word processing document
While in vi's command mode, you can type to undo a change. - Answers -u
To save a file and exit the vi text editor in command mode, type - Answers -ZZ
If you have never used a text editor before, the nano text editor is usually the best one
to learn first. - Answers -True
ASCII supports unique characters(not including control characters.) - Answers -128
GUI text editors for ASCII are superior to text-mode ASCII text editors because the GUI
editors support underlining, italics, and multiple fonts. - Answers -False
Unicode is useful for encoding most European languages but not not Asian languages. -
Answers -False
How would you remove two lines of text from a file when using vi? - Answers -In
command mode, position the cursor on the first line and type 2dd.
What is the name of the software that we downloaded. - Answers -Wingide
How would you write a test that says "if /tmp/foo is a directory or USERS is greater than
5"? - Answers -test -d /tmp/foo -o $USERS -gt 5
A conditional that lets you make multiple comparisons with a pattern is called: -
Answers -case
A file begins with #!/bin/csh. This means: - Answers -Running the script will invoke
/bin/csh to interpret the rest of the file
Most of nano's commands take the form of: - Answers -Control and another character
, How would you finish your script with an exit code of 42? - Answers -exit 42
Given the following script that is run through ./test.sh hello goodbye:
if [ -f $2 ]; then
echo "I am here"
fi
When will "I am here" be printed? - Answers -If a file called "goodbye" exists in the
current directory
The number of users logged in is in a variable called USERS. How would you test to
see if 5 users are logged in? - Answers -test $USERS -eq 5
What does this shell script do?
FOO=/tmp/foo
if [ ! -d $FOO ]; then
mkdir $FOO
fi - Answers -Creates /tmp/foo if it does not exist
Which shell command accepts input from the user's keyboard? - Answers -read
The if command looks for what exit code to consider a condition to be true? - Answers -
0
What is the correct way to assign the word "Hello" to a variable? - Answers -.
A="Hello"
Which of the following are correct about for and while loops? (choose two - Answers -
while loops have a test each cycle to determine if it should run again
for loops operate over a fixed list of items
Given the following part of a script:
if [ -f $1 ]; then
echo "I am here"
Which keystrokes invoke the pico or nano search function? - Answers -F6
Ctrl-W
Three keystrokes that can initiate a search-and-replace operation in nano are F14, , and
. - Answers -Ctrl+\
Esc+R
For which type of file is nano least likely to be useful for examining or editing? -
Answers -A LibreOffice word processing document
While in vi's command mode, you can type to undo a change. - Answers -u
To save a file and exit the vi text editor in command mode, type - Answers -ZZ
If you have never used a text editor before, the nano text editor is usually the best one
to learn first. - Answers -True
ASCII supports unique characters(not including control characters.) - Answers -128
GUI text editors for ASCII are superior to text-mode ASCII text editors because the GUI
editors support underlining, italics, and multiple fonts. - Answers -False
Unicode is useful for encoding most European languages but not not Asian languages. -
Answers -False
How would you remove two lines of text from a file when using vi? - Answers -In
command mode, position the cursor on the first line and type 2dd.
What is the name of the software that we downloaded. - Answers -Wingide
How would you write a test that says "if /tmp/foo is a directory or USERS is greater than
5"? - Answers -test -d /tmp/foo -o $USERS -gt 5
A conditional that lets you make multiple comparisons with a pattern is called: -
Answers -case
A file begins with #!/bin/csh. This means: - Answers -Running the script will invoke
/bin/csh to interpret the rest of the file
Most of nano's commands take the form of: - Answers -Control and another character
, How would you finish your script with an exit code of 42? - Answers -exit 42
Given the following script that is run through ./test.sh hello goodbye:
if [ -f $2 ]; then
echo "I am here"
fi
When will "I am here" be printed? - Answers -If a file called "goodbye" exists in the
current directory
The number of users logged in is in a variable called USERS. How would you test to
see if 5 users are logged in? - Answers -test $USERS -eq 5
What does this shell script do?
FOO=/tmp/foo
if [ ! -d $FOO ]; then
mkdir $FOO
fi - Answers -Creates /tmp/foo if it does not exist
Which shell command accepts input from the user's keyboard? - Answers -read
The if command looks for what exit code to consider a condition to be true? - Answers -
0
What is the correct way to assign the word "Hello" to a variable? - Answers -.
A="Hello"
Which of the following are correct about for and while loops? (choose two - Answers -
while loops have a test each cycle to determine if it should run again
for loops operate over a fixed list of items
Given the following part of a script:
if [ -f $1 ]; then
echo "I am here"