Linux Admin

Linux Admin

Professional Development

6 Qs

quiz-placeholder

Similar activities

Sine Bar

Sine Bar

Professional Development

9 Qs

Quiz Moulin Rouge - Fin

Quiz Moulin Rouge - Fin

Professional Development

6 Qs

Monitoring Work Quiz PT7

Monitoring Work Quiz PT7

Professional Development

10 Qs

Campus Overviews

Campus Overviews

Professional Development

11 Qs

aFT NHT GLS Week 3 (Admin Tables) Nov 2021

aFT NHT GLS Week 3 (Admin Tables) Nov 2021

Professional Development

10 Qs

Kaelin

Kaelin

KG - Professional Development

10 Qs

Team Riveter's Mega Party Trivia

Team Riveter's Mega Party Trivia

Professional Development

10 Qs

5S System

5S System

Professional Development

10 Qs

Linux Admin

Linux Admin

Assessment

Quiz

Other

Professional Development

Hard

Used 8+ times

FREE Resource

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