
Linux Admin
Quiz
•
Other
•
Professional Development
•
Practice Problem
•
Hard
Used 8+ times
FREE Resource
Enhance your content in a minute
6 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
Suppose that you have an application whose behavior depends on the environment variable BAR. Which of the following command lines may be used in a bash shell to configure the application?
export $BAR=baz; echo $BAR
set BAR=baz
BAR=baz ; export BAR
echo BAR=baz
declare -x BAR=baz
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following commands can be used to assure that a file 'myfile' exists?
cp myfile /dev/null
touch myfile
create myfile
mkfile myfile
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following command lines can be used to convert a file containing DOS-style CR-LF line endings into Unix-style LF line endings? Assume for this question that the DOS-style file is called 'dosfile', and we want the modified contents in 'unixfile'
sed 's/\r//' dosfile > unixfile
tr -d '\r' < dosfile > unixfile
dos2unix dosfile unixfile
strip '\r' < dosfile > unixfile
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Suppose for this question that you have a file called 'wordlist' that contains a number of words, one per line. You would like to produce an ad-hoc report that contains a numbered list of the first five words, according to alphabetical order. Which of the following command lines can be used to produce this report to the console?
sort wordlist | nl | head -5
split -1 wordlist ; cat xa? | head -5
nl wordlist | sort | sed '/^ [^12345]/d'
nl wordlist | sort | head -5
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The command 'ps -A' displays an ordered list of all running processes, with the right-justifed process ID in the first space-separated field. Suppose you would like to display to screen a list of the five most recently launched processes (those with the highest process IDs). Which of the following
commands will display the desired items?
ps -A | tail -5 | cut -f 1 -d " "
ps -A | tail -5 | sed 's/[ ]*[0-9]*//'
ps -A | head -5 | nl
ps -A | tac | head -5 | cut -b 0-5
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Suppose that a file 'names' contains a list of names in the form, "firstname lastname", one per line. These names are unsorted, and you would like them sorted by lastname; however, the format of names on each line should remain the same. Which ONE of the following commands will NOT output an appropriately sorted list of names to the console?
cut -f 2 -d " " names | paste names - | sort -k 3 | cut -f 1
sort -k 2 names
sed 's/\(\w*\) \(\w*\)/\2\1\2/' names | sort | cut -f2-3 -d" "
cut -f 2 -d " " names | sort
cut -f 2 -d " " names | paste - names | sort | cut -f 2
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
SUB SWITCH BOARD
Quiz
•
Professional Development
10 questions
Suspension
Quiz
•
Professional Development
10 questions
Tom Holland Quiz
Quiz
•
5th Grade - Professio...
10 questions
Trivia!
Quiz
•
Professional Development
10 questions
Holiday Movie Trivia
Quiz
•
Professional Development
11 questions
Healthy Eating Knowledge
Quiz
•
10th Grade - Professi...
10 questions
Storemode.2
Quiz
•
Professional Development
10 questions
SMDP36 - Data Driven Decision Making
Quiz
•
Professional Development
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
Discover more resources for Other
10 questions
How to Email your Teacher
Quiz
•
Professional Development
6 questions
3RD GRADE DECLARATION OF INDEPENDENCE EXIT TICKET
Quiz
•
Professional Development
19 questions
Black History Month Trivia
Quiz
•
6th Grade - Professio...
22 questions
Multiplying Exponents with the Same Base
Quiz
•
9th Grade - Professio...
40 questions
Flags of the World
Quiz
•
KG - Professional Dev...
