LearnThatStack Ace your next interview
System Administration
Shell Scripting (Bash/Zsh).
32 Qs 4 free
Change topic Change
Drill · questions

All questions

of 32
Beginner 8
01

What is the difference between a shell and a terminal?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

A terminal is a program that provides a text-based interface to interact with the system, while a shell is the command-line interpreter that processes and executes commands entered in the terminal.

The terminal handles input/output display, while the shell interprets commands, manages environment variables, handles job control, and executes programs. Common shells include Bash, Zsh, Fish, and Dash.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

02

How do you make a shell script executable?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Use the chmod command to add execute permissions:

chmod +x script.sh
# Or using octal notation
chmod 755 script.sh

You also need to include a shebang line at the top of the script:

#!/bin/bash
# or
#!/usr/bin/env bash
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

03

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

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

The shebang tells the system which interpreter to use when executing the script. It must be the first line of the script and starts with #! followed by the path to the interpreter.

#!/bin/bash          # Use bash shell
#!/usr/bin/env bash  # Use bash from PATH (more portable)
#!/bin/zsh           # Use zsh shell
#!/usr/bin/env python3  # Use Python 3
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

04

How do you declare and use variables in bash?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Variables are declared without spaces around the equals sign and accessed with the $ symbol:

# Declaration
name="John"
age=25

# Usage
echo "Name: $name, Age: $age"
echo "Name: ${name}, Age: ${age}"  # Preferred syntax
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

05

What's the difference between single quotes, double quotes, and backticks?

Part of Pro
06

How do you pass arguments to a shell script?

Part of Pro
07

What are exit codes and how do you use them?

Part of Pro
08

How do you redirect standard output and standard error?

Part of Pro
Intermediate 10
09

Explain the difference between `$@` and `$*`

Part of Pro
10

How do you implement conditional statements in bash?

Part of Pro
11

What's the difference between `[` and `[[` in bash?

Part of Pro
12

How do you create and use arrays in bash?

Part of Pro
13

Explain different types of loops in bash

Part of Pro
14

How do you define and call functions in bash?

Part of Pro
15

What are pipes and how do you use them?

Part of Pro
16

How do you handle errors in shell scripts?

Part of Pro
17

What is command substitution and how do you use it?

Part of Pro
18

How do you process command-line options in bash?

Part of Pro
Expert 14
19

Explain parameter expansion and its advanced features

Part of Pro
20

How do you implement signal handling in bash scripts?

Part of Pro
21

What are file descriptors and how do you manipulate them?

Part of Pro
22

How do you implement process synchronization in bash?

Part of Pro
23

Explain process substitution and its use cases

Part of Pro
24

How do you implement a robust logging system in bash?

Part of Pro
25

How do you implement parallel processing in bash?

Part of Pro
26

What are coprocesses and how do you use them?

Part of Pro
27

How do you implement dynamic variable names and indirect references?

Part of Pro
28

How do you implement complex regular expressions in bash?

Part of Pro
29

How do you implement error recovery and retry mechanisms?

Part of Pro
30

How do you implement performance profiling in bash scripts?

Part of Pro
31

How do you implement secure scripting practices?

Part of Pro
32

How do you debug complex bash scripts effectively?

Part of Pro

No matches

Try a different filter or search term.

Pro · $10/mo

28 of 32 Shell Scripting (Bash/Zsh) answers are gated.

Full answers, code samples, AI explanations - simpler, deeper, or as an interactive diagram. Cancel anytime.

  • Full answers + code
  • AI explain - simpler, deeper, or visualized
  • 1,000 AI credits / month
  • Cancel anytime

Change topic

Pick a different technology or stack. Your current topic stays put until you choose a new one.

Technologies
No technologies match “”.
Cross-cutting topics
No topics match “”.
By role
Stacks & frameworks

MEAN

MongoDB, Express, Angular, Node.js

MERN

MongoDB, Express, React, Node.js

LAMP

Linux, Apache, MySQL, PHP

Django

Python Full-Stack Development

Ruby on Rails

Convention over Configuration

JAM

JavaScript, APIs, and Markup

Serverless on AWS

Serverless Architecture on AWS

Cross-cutting topics 43 topics

Interviewers also test these - they're common to every stack, whichever one you picked above.

Flutter Mobile

Flutter Cross-Platform Mobile Development

Cross-cutting topics 44 topics

Interviewers also test these - they're common to every stack, whichever one you picked above.

Spring Boot

Enterprise Java Development

.NET

Microsoft Ecosystem

Vue

Vue.js, Vite, TypeScript, Tailwind, Node.js

Go Backend

Golang, gRPC, PostgreSQL, Redis, RabbitMQ

FastAPI

Python, FastAPI, SQLAlchemy, PostgreSQL

React Native

React, TypeScript, Redux, Firebase

iOS Native

Swift, SwiftUI, UIKit, Firebase

Android Native

Java, Jetpack Compose, Firebase

Web3 / Ethereum

Solidity, Ethereum, Hardhat, Foundry

DevOps / Platform

Docker, Kubernetes, Terraform, CI/CD

Core SWE Interview Prep

Data structures, algorithms, OS, concurrency, networking, git
Big-O & Complexity Analysis Arrays, Strings & Hash Tables Linked Lists, Stacks & Queues Trees, BSTs & Heaps Graphs Sorting, Searching & Recursion Operating Systems Concurrency & Multithreading Networking for Developers Git & Version Control API Design 45 Distributed Systems Fundamentals 34

Cross-cutting topics 43 topics

Interviewers also test these - they're common to every stack, whichever one you picked above.


Cross-cutting topics 45 topics

Interviewers also test these - they're common to every stack, whichever one you picked above.