Bash Tutorial menu

Bash Quiz

Check what you have learned in the Bash tutorial with these questions.

How the Quiz Works

  • 9 questions cover every lesson
  • Choose one answer for each
  • Read the explanation after you answer
  • Go back to the lesson for any question you miss

Quiz Questions

Exercise

Which command shows the folder you are in now?

Exercise

What makes a script file executable?

Exercise

Which command deletes a folder and everything in it?

Exercise

What does the pipe symbol do in: sort names.txt | uniq?

Exercise

What does echo 'Hi $name' print if name="Ali"?

Exercise

What does echo $((10 / 4)) print?

Exercise

Which test is true when backups is an existing folder?

Exercise

Which loop keeps running until its condition becomes true?

Exercise

In a script, what does $# hold?

What Next?

Well done on finishing the Bash tutorial. Practise by automating something real: back up a folder every day, rename a set of photos, or check whether a website is online. Then learn cron to run your scripts on a schedule.

Keep your scripts safe: quote your variables, test them on sample files first, and add set -e at the top so a script stops at the first error.

Learn Bash with a teacher

Join the Python Programming course at Workownix, online or in Orangi Town, Karachi, and get a certificate.

See the course Ask on WhatsApp