Build a Better Process

Linux Quiz 2c Covering cp, head, sort, comm and grep Commands

This is the seventh quiz with a video set to relaxing music.
  1. Study - Review the first 20 commands in the Linux Essentials YouTube Playlist, or 20 web pages found here.
  2. Quiz - Watch the video and see how many answers you get correct.
  3. Next - When you're ready to move on to the next Quiz click Next.
face pic by Paul Alan Davis, CFA
Updated: February 24, 2021
As with learning to code, the feedback loop is vital and here we cover the second 10 commands from Linux Essentials so you can see what you need to reinforce.

Outline Back Tip Next

/ factorpad.com / tech / linux-essentials / quiz-2c.html

An ad-free and cookie-free website.

Linux Command Line Quiz | 2c


This is a quiz accompanying the Linux Essentials Tutorial series and comes in both video and text-based content. Here in HTML we cover commands 21-40. Start with the YouTube video set to cool music or jump right in here.

The Linux command line quiz in video runs for 6 1/2 minutes and is a little more difficult than the free text-based quiz below. The 25 questions are the same however. Either way you should have fun and it will be a good challenge. Please enjoy and happy learning!


Videos can also be accessed from the Linux Essentials Playlist on YouTube.

Linux Command Line Quiz for Beginners | 2c (6:28)

The Quiz

It's easy, click the box to display the answer.

You may need to upgrade from Internet Explorer to use this functionality.


How do you show a count of words in file1.txt?

$ wc -w file1.txt


How do you sort the bash history file then count each unique line?

$ sort .bash_history | uniq -c


How do you make a symbolic link to documents directory calling it doc?

$ ln -s documents doc


How do you use NA for blank data when joining file1.txt and file2.txt?

$ join -e NA file1.txt file2.txt


How do you show the first 5 lines of the .bashrc file?

$ head -n 5 .bashrc


How do you delete a directory called files and its contents?

$ rm -r files


How do you show common lines in file1.txt and file1.bak?

$ comm -12 file1.txt file1.bak


How do you select a second file's contents when prompted by sdiff?

$ r


How do you copy file1.txt to an existing directory called backup?

$ cp file1.txt backup


How do you make a templates directory in another called app?

$ mkdir -p app/templates


How do you select characters two to four in each row of file1.txt?

$ cut -c 2-4 file1.txt


How do you show programs that start with grep?

$ apropos -w grep*


How do you show the number of lines in file1.txt?

$ wc -l file1.txt


How do you create a bin directory with a confirmation message?

$ mkdir -v bin


How do you create file2.txt that is file1.txt sorted?

$ sort --output='file2.txt' file1.txt


How do you print lines in .bashrc that include the term case?

$ grep "case" .bashrc


How do you show the last 7 lines of the .bash_history file?

$ tail -n 7 .bash_history


How do you create a reminder before deleting file1.txt?

$ rm -i file1.txt


How do you show changes needed to make file1.txt equal file2.txt?

$ diff file1.txt file2.txt


How do you find files in the bin directory including zip in the name?

$ find /bin -name '*zip*'


How do you select rows in .bash_history with the word nano?

$ grep "nano" .bash_history


How do you paste rows in file1.txt and file2.txt without a delimiter?

$ paste file1.txt file2.txt


How do you edit file1.txt with the correct spelling of hmtl as html?

$ sed -i 's/hmtl/html/' file1.txt


How do you move file1.txt into docs directory only if it is newer?

$ mv -u file1.txt docs


How do you see a prompt before copying file1.txt to file1.bak?

$ cp -i file1.txt file1.bak

Learn More About The Series

For an overview of the 100 videos, the 8 quizzes, a cheat sheet, the categories and a Q&A section, visit:

What's Next?

There is no limit to what is possible if you keep learning Linux and data science. Connect today.

Outline Back Tip Next

/ factorpad.com / tech / linux-essentials / quiz-2c.html

science quiz
linux basic commands
linux shell commands
online quiz game
computer quiz
linux command line quiz
free quiz
cp command quiz
head command quiz
sort command quiz
comm command quiz
grep command quiz

A newly-updated free resource. Connect and refer a friend today.