Skip to content

Shell Scripting Basics – Full Quiz

Back to Quiz Home


This quiz contains 20 questions focused on Shell Scripting fundamentals. It helps you understand variables, execution, error handling, and basic commands.


#

What is a Shell Script?

#

Which symbol starts a comment in a shell script?

#

What is the purpose of the Shebang (#!) line?

#

How do you assign a value to a variable in Bash?

#

How do you print the value of a variable named NAME?

#

Which command makes a script executable?

#

What does $? represent?

#

Which command stops the script immediately upon error?

#

What is the difference between single (') and double (") quotes?

#

How do you run a script named test.sh in the current directory?

#

Which variable holds all command-line arguments as a single string?

#

Which variable holds the number of arguments passed to the script?

#

How do you read user input into a variable?

#

What is $0 inside a script?

#

How do you check if a file exists using if?

#

Which operator checks if a directory exists?

#

How do you append output to a file?

#

What creates a readonly variable?

#

How do you debug a bash script to print every command executed?

#

What happens if you don't provide a shebang?

Quiz Progress

0 / 0 questions answered (0%)

0 correct


📚 Study Guides


📬 Weekly DevOps, Cloud & Gen AI quizzes & guides