This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Choose the best response for each question.
In our current directory, we want to find the three files with the least number of lines. Which command would work?
wc -l * > sort -n > head -n 3
wc -l * | sort -n | head -n 1-3
wc -l * | sort -n | head -n 3
wc -l * | head -n 3 | sort -n
What will the regular expression Fr[ea]nc[eh] match?
Fr[ea]nc[eh]
French, France, Frence, Franch
Frenche, Franceh, Frenceh, Franche
France, French
Freanceh, Fraenche
The -v option to the grep command inverts pattern matching so that only lines that don't match the pattern are printed. Which of the following commands finds all files in the /data directory whose names end in s.txt, but whose names also don't contain the string net? Examples are shuttles.txt or software.txt, but not planets.txt.
-v
grep
s.txt
net
shuttles.txt
software.txt
planets.txt
find data -name *s.txt | grep -v net
grep -v 'net' $(find data -name '*s.txt')
find data -name '*s.txt' | grep -v net
None of these commands
Suppose you want to delete some processed data files and save storage by only keeping your raw files and processing script. The raw files end in .dat, and the processed files end in .txt. Which of the following solutions would remove all of the processed data files, and no other files?
.dat
.txt
rm ?.txt
rm *.txt
rm * .txt
rm *.*
You must answer all questions before checking your work.
Was this page helpful?