Which command displays text on the terminal?, echo, read, Which symbol is used to assign a value to a variable?, =, ==, Which symbol is used to access the value stored in a variable?, $, &, Which operator redirects output to overwrite a file?, >, >>, Which operator appends output to an existing file?, >>, >, Which command is used to perform arithmetic calculations?, expr, put, Which command counts the number of lines in a file using a pipe?, cat file | wc -l, wc -l file, Which command reads user input?, read, echo, $q, Which command displays the current working directory?, pwd, cd, What is a shell script?, Database table, Image editor, Network cable, Command file, Which symbol starts a comment in a shell script?, /*, --, #, //, Which command displays text on the terminal?, read, echo, case, test, Which command creates an empty script file?, pwd, grep, sort, touch, Which command can open a script in a terminal editor?, ping, who, nano, date, How do you make a script executable?, cp +x, chmod +x, ls -x, mkdir -x, Which command runs a script named test.sh?, mv test.sh, ls test.sh, ./test.sh, rm test.sh, Which command reads user input in a shell script?, read, echo, printf, cat, How is a variable assigned in Bash?, set name=value, name = value, value:name, name=value, How do you access a variable named user?, user$, $user, %user, @user, Which command prints a variable value?, read $var, case $var, test $var, echo $var, Which redirection symbol sends output to a file?, &, |, >, <, Which symbol appends output to a file?, >>, ||, <, <<, Which symbol redirects input from a file?, >, <, |, &&, What does a pipe do?, Deletes files, Starts editor, Links commands, Stops script, Which symbol is used for piping?, &, ;, #, |, What does ls | sort do?, Sorts ls output, Creates a script, Reads user input, Deletes sorted files, Which command is often used to perform integer math?, echo, expr, mkdir, pwd, Which syntax performs arithmetic expansion?, [[]], (($ )), $(( )), ${{ }}, What does exit 0 usually mean?, User input, Success, Infinite loop, Syntax error, Which keyword follows the condition in if?, else, fi, do, then, Which keyword ends an if block?, stop, end, fi, done, Which keyword provides an alternate branch in if?, else, elif, do, fi, Which keyword adds another condition after if?, case, elif, break, until, What is nested if?, Comment block, If inside if, Loop in file, Pipe in pipe, Which command checks conditions in shell scripts?, echo, touch, test, cat, Which notation is another form of test?, ( ), { }, [ ], What does -eq test?, Equal numbers, Text match, String empty, File exists, What does -ne mean?, Not equal, No error, Name exists, New file, What does -gt mean?, Group test, Go terminal, Greater than, Get text, What does -lt mean?, Load terminal, Link target, List text, Less than, Which operator checks if a file is readable?, -r, -x, -w, -d, Which operator checks if a file is writable?, -r, -w, -f, -s, Which operator checks if a file is executable?, -e, -z, -n, -x, Which operator checks if a path is a directory?, -t, -f, -d, -s, Which operator checks if a path is a regular file?, -w, -x, -f, -d, Which operator is true for an empty string?, -x, -z, -n, -d, Which operator means logical AND in tests?, -a, -eq, -o, -ne, Which operator means logical OR in tests?, -o, -lt, -a, -gt, Which command is useful for matching one value against many choices?, exit, read, case, expr, Which keyword ends a case statement?, fi, done, stop, esac
0%
Shell Scripting Basics and Structured Commands MCQ
Share
Share
by
Amolbackup2025
Edit Content
Print
Embed
More
Assignments
Leaderboard
Show more
Show less
This leaderboard is currently private. Click
Share
to make it public.
This leaderboard has been disabled by the resource owner.
This leaderboard is disabled as your options are different to the resource owner.
Revert Options
Open the box
is an open-ended template. It does not generate scores for a leaderboard.
Log in required
Visual style
Fonts
Subscription required
Options
AI Enhanced: This activity contains content generated by AI.
Learn more.
Switch template
Show all
Open results
Copy link
QR code
Delete
Continue editing:
?