Faster Learning Tutorials

~/ home  / technology  / linux essentials  / quiz 2c

Linux Quiz 2c covering cp, head, sort, comm, grep, and...

This is a quiz accompanying the Linux Essentials Tutorial series and comes in both video and text-based content. Here 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, either way you should have fun and it will be a good challenge. Please enjoy and happy learning!

Video and quiz by Paul Alan Davis, CFA, December 18, 2016
Updated: August 1, 2017

Linux Command Line Quiz | 2c


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

Videos can also be accessed from the YouTube Playlist.

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:

Linux Essentials Home

What's Next?

Here's a link to subscribe to our YouTube Channel because there's no limit to what's possible if you keep learning Linux and data science.

  • Click Outline to see all content including other quizzes
  • Click Back for Linux Essentials
  • Click Next to take another Quiz

Outline Back Next

~/ home  / technology  / linux essentials  / quiz 2c

science quiz
Linux basic commands
Linux shell commands
online quiz game
computer quiz
free quiz