TechBeamersTechBeamers
  • Viral Tips 🔥
  • Free CoursesTOP
  • TutorialsNEW
    • Python Tutorial
    • Python Examples
    • C Programming
    • Java Programming
    • MySQL Tutorial
    • Selenium Tutorial
    • Selenium Python
    • Playwright Python
    • Software Testing Tutorial
    • Agile Concepts
    • Linux Concepts
    • HowTo Guides
    • Android Topics
    • AngularJS Guides
    • Learn Automation
    • Technology Guides
  • Top Interviews & Quizzes
    • SQL Interview Questions
    • Testing Interview Questions
    • Python Interview Questions
    • Selenium Interview Questions
    • C Sharp Interview Questions
    • Java Interview Questions
    • Web Development Questions
    • PHP Interview Questions
    • Python Quizzes
    • Java Quizzes
    • Selenium Quizzes
    • Testing Quizzes
    • HTML CSS Quiz
    • Shell Script Quizzes
  • ToolsHOT
    • Python Online Compiler
    • Python Code Checker
    • C Online Compiler
    • Review Best IDEs
    • Random Letter Gen
    • Random Num Gen
TechBeamersTechBeamers
Search
  • Viral Tips 🔥
  • Free CoursesTOP
  • TutorialsNEW
    • Python Tutorial
    • Python Examples
    • C Programming
    • Java Programming
    • MySQL Tutorial
    • Selenium Tutorial
    • Selenium Python
    • Playwright Python
    • Software Testing Tutorial
    • Agile Concepts
    • Linux Concepts
    • HowTo Guides
    • Android Topics
    • AngularJS Guides
    • Learn Automation
    • Technology Guides
  • Top Interviews & Quizzes
    • SQL Interview Questions
    • Testing Interview Questions
    • Python Interview Questions
    • Selenium Interview Questions
    • C Sharp Interview Questions
    • Java Interview Questions
    • Web Development Questions
    • PHP Interview Questions
    • Python Quizzes
    • Java Quizzes
    • Selenium Quizzes
    • Testing Quizzes
    • HTML CSS Quiz
    • Shell Script Quizzes
  • ToolsHOT
    • Python Online Compiler
    • Python Code Checker
    • C Online Compiler
    • Review Best IDEs
    • Random Letter Gen
    • Random Num Gen
Follow US
© TechBeamers. All Rights Reserved.
Linux TutorialsShell Script Quiz

Unix Shell Scripting Quiz for Beginners – 25 Questions

Last updated: Mar 06, 2025 10:31 am
Harsh S.
By
Harsh S.
Harsh S. Avatar
ByHarsh S.
Hello, I'm Harsh, I hold a degree in Masters of Computer Applications. I have worked in different IT companies as a development lead on many large-scale...
Follow:
No Comments
2 months ago
Share
11 Min Read
SHARE

Today, we’ve come up with an interesting Unix Shell scripting quiz featuring 25 best questions to help you learn Unix programming. Both software developers and automation engineers should attempt this quiz and assess their shell scripting knowledge.

We’ve some more interesting Linux quizzes and online tests available here. You may want to check that out as well.

The primary reason to roll out this quiz was to meet the promise that we’ve made to our readers who were asking for a quiz on shell scripting for quite a time. And we’ve tried to add all the relevant Unix shell scripting questions in this quiz to make it as useful as it could be.

Attempt The Quiz And Learn Unix Shell Scripting.

Note: You can view all the answers at the end of this quiz.

Answer Key with Reasoning

Here is a concise reasoning table explaining the correct answers for all 25 Linux-related questions.

Q#Correct AnswerReasoning
1Bash, C shell, Korn shell, Z shell, tcsh, B shellThese are commonly used shells in Linux, providing various scripting capabilities.
2Soft links reference filenames, Hard links reference inodesSoft links (symbolic) point to file names, while hard links reference inodes (actual data blocks).
3Number of passed arguments$# in a shell script returns the count of arguments passed to the script.
42>&1, &>Both redirect standard error (stderr) and standard output (stdout) together.
5Last command exit status$? holds the exit status (success or failure) of the last executed command.
6if [ $x -gt $y ]The correct syntax for numeric comparisons in shell scripting.
7Defines script interpreter, Known as a shebang, Executes script with bash#!/bin/bash specifies that the script should be executed using the Bash shell.
8sh -x script.sh, sh -nv script.sh-x enables debugging, -nv checks syntax without executing the script.
9'read' commandThe read command in shell scripts allows user input.
10expr 7 + 3, test=$[12 + 3]expr and $[] are used for arithmetic operations in shell scripts.
11function test() {}, test() { return 1; }Both syntaxes correctly define functions in shell scripts.
12$$ = Current process ID, $! = Last background process$$ gives the current shell’s process ID, while $! stores the PID of the last background process.
13ftp, scp, rsyncftp, scp, and rsync are used to transfer files between machines.
14telnet, sshtelnet and ssh allow executing commands on remote machines.
15Replaces current shell processexec replaces the current shell process with the specified command instead of starting a new one.
16Disk blockLinux filesystems do not use a block specifically named “Disk block”; they use data, inode, and superblocks.
17Super blockThe superblock contains metadata about the filesystem, such as size and state.
18Boot blockThe boot block contains the Master Boot Record (MBR), which is essential for system startup.
19array=("Hello" "World")This is the correct syntax to define an array in Bash.
20echo ${array[0]}In Bash, ${array[0]} accesses the first element of an array.
21echo ${array[@]}${array[@]} prints all elements of an array.
22echo ${!array[@]}${!array[@]} returns all indexes of the array.
23unset array[3]The unset command removes an element from an array in Bash.
24array[99]="New_element"This syntax correctly assigns a new value at index 99 in a Bash array.
25uptimeThe uptime command shows how long the system has been running.

This table provides quick and precise reasoning for each correct answer while ensuring technical accuracy.

Key Takeaways from Unix Shell Scripting Quiz

Interested software developers and test automation engineers are welcome to refer to our lately published posts on Python.

  • Python tips and tricks
  • Python multithreading
  • Python interview questions

We wish that this quiz would help both software developers and testers in sharpening their overall Unix operating systems skills.

Next, we expect that all software developers and automation test engineers would have fun trying the quiz and appreciate us for coming out with such a post. Rest assured that we’ll keep coming up with new quizzes on new subjects and will update the earlier ones as well.

You can also support our knowledge campaign by sharing this post with your friends and on social media platforms.

All the Best,
TechBeamers

Related

TAGGED:Linux Fresher Questionsprogramming
Share This Article
Flipboard Copy Link
Subscribe
Notify of
guest

guest

0 Comments
Newest
Oldest
Inline Feedbacks
View all comments

List of Topics

Stay Connected

FacebookLike
XFollow
YoutubeSubscribe
LinkedInFollow

Subscribe to Blog via Email

Enter your email address to subscribe to latest knowledge sharing updates.

Join 1,009 other subscribers

Continue Reading

  • Shell Script Quiz for Unix/Linux GeeksJan 10
  • C++ Programming Quiz – Beginner LevelAug 28
  • Top 30 Linux Interview Questions for BeginnersSep 3
  • 30 Linux Questions – Online TestSep 4
  • Makefile Tutorial to Create Client-Server ProgramSep 6
  • Set Static IP on Windows, Ubuntu & OS XJun 16
  • Simple Steps to Create a Service in LinuxJul 10
  • Learn to Implement C++ Class in C ProgrammingJul 21
  • How to Use GDB with Six Debugging TipsAug 3
  • Ant Script to Change System Date-TimeAug 5
View all →

RELATED TUTORIALS

Learn Everything about AngularJS Expressions from Scratch

Learn Everything about AngularJS Expressions

By Meenakshi Agarwal
1 week ago
AngularJS Overview - Self Start Tutorial for Beginners

AngularJS Overview and Quick Start Guide

By Meenakshi Agarwal
1 month ago
C++ Programming Quiz for Beginners

C++ Programming Quiz – Beginner Level

By Meenakshi Agarwal
2 months ago
Linux Basic Questions And Answers for Beginners

30 Linux Basic Questions And Answers

By Meenakshi Agarwal
8 months ago
© TechBeamers. All Rights Reserved.
  • About
  • Contact
  • Disclaimer
  • Privacy Policy
  • Terms of Use
wpDiscuz