0
0
Linux CLIscripting~10 mins

Linux distributions overview (Ubuntu, CentOS, Fedora) in Linux CLI - Step-by-Step Execution

Choose your learning style9 modes available
Concept Flow - Linux distributions overview (Ubuntu, CentOS, Fedora)
Start: Choose Linux Distribution
Ubuntu Features
CentOS Features
Fedora Selected?
YesFedora Features
No
Unknown Distribution
End
The flow shows choosing a Linux distribution and then exploring its features based on selection.
Execution Sample
Linux CLI
echo "Choose your Linux distro: Ubuntu, CentOS, Fedora"
read distro
case $distro in
  Ubuntu) echo "You chose Ubuntu: user-friendly, popular, good support.";;
  CentOS) echo "You chose CentOS: stable, enterprise-focused, RHEL-based.";;
  Fedora) echo "You chose Fedora: cutting-edge, latest features, community-driven.";;
  *) echo "Unknown distribution.";;
esac
This script asks the user to enter a Linux distribution name and then prints a short description about it.
Execution Table
StepActionInput/ConditionResult/Output
1Prompt userN/ADisplays: Choose your Linux distro: Ubuntu, CentOS, Fedora
2User inputUbuntuStores 'Ubuntu' in variable distro
3Check distrodistro == UbuntuTrue, prints: You chose Ubuntu: user-friendly, popular, good support.
4EndN/AScript ends after printing message
💡 User input matches Ubuntu, script prints Ubuntu info and ends.
Variable Tracker
VariableStartAfter InputFinal
distroemptyUbuntuUbuntu
Key Moments - 2 Insights
Why does the script print Ubuntu info when I type 'Ubuntu' exactly but not when I type 'ubuntu'?
The case statement checks for exact matches including case. 'Ubuntu' matches but 'ubuntu' does not, so no branch is taken for lowercase input as shown in execution_table step 3.
What happens if I type a distribution name not listed like 'Debian'?
The default case (*) catches any input not matching Ubuntu, CentOS, or Fedora and prints 'Unknown distribution.' This is not shown in the current execution_table but is part of the script logic.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, what is the value of 'distro' after user input?
A"Ubuntu"
B"CentOS"
C"Fedora"
D"empty"
💡 Hint
Check variable_tracker row for 'distro' after input.
At which step does the script print the message about Ubuntu?
AStep 1
BStep 3
CStep 2
DStep 4
💡 Hint
Look at execution_table step where condition distro == Ubuntu is true.
If the user types 'Fedora' instead of 'Ubuntu', what changes in the execution table?
AStep 4 prints Unknown distribution
BStep 2 input changes to Fedora but output stays Ubuntu message
CStep 3 output changes to Fedora message
DNo change
💡 Hint
Consider how the case statement matches input to output messages.
Concept Snapshot
Linux distributions differ in purpose and features.
Use 'case' in shell scripts to handle user input.
Exact match is needed for case options.
Default (*) handles unknown inputs.
Ubuntu: user-friendly.
CentOS: stable enterprise.
Fedora: latest features.
Full Transcript
This visual execution shows a simple shell script that asks the user to choose a Linux distribution among Ubuntu, CentOS, and Fedora. The script reads the input and uses a case statement to print a short description about the chosen distribution. The flow diagram shows the decision path based on user input. The execution table traces each step: prompting, input reading, condition checking, and output printing. The variable tracker shows how the variable 'distro' changes from empty to the user input. Key moments clarify common confusions about case sensitivity and unknown inputs. The quiz tests understanding of variable values and script flow. The snapshot summarizes key points about Linux distributions and shell scripting with case statements.