Linux Admin

Linux Admin

Professional Development

6 Qs

quiz-placeholder

Similar activities

BLACKPINK

BLACKPINK

1st Grade - Professional Development

10 Qs

QUIZZICAL SERIES - ACCOUNTING FOR MANAGEMENT

QUIZZICAL SERIES - ACCOUNTING FOR MANAGEMENT

University - Professional Development

10 Qs

RA 9745

RA 9745

Professional Development

10 Qs

Suspension Fundamentals

Suspension Fundamentals

Professional Development

11 Qs

harry potter

harry potter

KG - Professional Development

10 Qs

แป้นเหย้า

แป้นเหย้า

Professional Development

10 Qs

Pokemon

Pokemon

KG - Professional Development

11 Qs

C2_Art and creativity

C2_Art and creativity

Professional Development

10 Qs

Linux Admin

Linux Admin

Assessment

Quiz

Other

Professional Development

Practice Problem

Hard

Used 8+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?