Bird
Raised Fist0
Linux CLIscripting~10 mins

Opening and using the terminal in Linux CLI - Step-by-Step Execution

Choose your learning style10 modes available
Concept Flow - Opening and using the terminal
User wants to run commands
↓
Open Terminal Application
↓
Terminal window appears
↓
User types command
↓
Terminal processes command
↓
Output shown in terminal
↓
User types next command or closes terminal
This flow shows how a user opens the terminal, types commands, and sees the output step-by-step.
Execution Sample
Linux CLI
echo Hello, Terminal!
ls
pwd
This sample shows typing three commands: print text, list files, and show current folder.
Execution Table
StepUser ActionTerminal ResponseOutput
1Open terminal appTerminal window opens
2Type: echo Hello, Terminal!Process echo commandHello, Terminal!
3Type: lsList files in current directoryfile1.txt file2.txt script.sh
4Type: pwdShow current directory path/home/user
5Close terminalTerminal window closes
💡 User closes terminal or stops typing commands
Variable Tracker
VariableStartAfter Step 2After Step 3After Step 4Final
Terminal WindowClosedOpenOpenOpenClosed
Last CommandNoneecho Hello, Terminal!lspwdNone
Last OutputNoneHello, Terminal!file1.txt file2.txt script.sh/home/userNone
Key Moments - 3 Insights
Why do I see a prompt waiting after opening the terminal?
The prompt means the terminal is ready to accept your commands, as shown in step 1 and 2 of the execution_table.
What happens if I type a command that the terminal does not recognize?
The terminal will show an error message instead of output, similar to step 3 but with an error instead of file list.
Why does the terminal show output after I type a command?
The terminal runs the command and prints the result, as seen in steps 2, 3, and 4 in the execution_table.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, what is the output after typing 'echo Hello, Terminal!'?
Afile1.txt file2.txt script.sh
BHello, Terminal!
C/home/user
DTerminal window opens
💡 Hint
Check the Output column at Step 2 in the execution_table.
At which step does the terminal show the current directory path?
AStep 4
BStep 3
CStep 2
DStep 5
💡 Hint
Look at the User Action and Output columns in the execution_table.
If the user closes the terminal at Step 5, what is the state of the Terminal Window in variable_tracker?
AProcessing command
BOpen
CClosed
DWaiting for input
💡 Hint
Check the Terminal Window row in variable_tracker at the Final column.
Concept Snapshot
Opening and using the terminal:
- Open terminal app to get a command prompt
- Type commands and press Enter
- Terminal runs commands and shows output
- Repeat typing commands or close terminal to exit
- Terminal shows errors if command unknown
Full Transcript
This lesson shows how to open and use the terminal on a Linux system. First, the user opens the terminal application, which displays a window with a prompt. The user types commands like 'echo Hello, Terminal!', 'ls', and 'pwd'. Each command runs when Enter is pressed, and the terminal shows the output below the command. The user can continue typing commands or close the terminal window to finish. The execution table traces each step, showing user actions and terminal responses. The variable tracker shows the terminal window state, last command, and output changing over time. Key moments clarify why the prompt appears, what happens with unknown commands, and why output shows after commands. The quiz tests understanding of outputs and terminal states at different steps. This visual trace helps beginners see exactly how the terminal works step-by-step.

Practice

(1/5)
1. What is the main purpose of opening a terminal on a Linux system?
easy
A. To type commands to control the computer
B. To watch videos
C. To browse the internet
D. To play music

Solution

  1. Step 1: Understand what a terminal does

    The terminal allows users to type commands to control and manage the computer.
  2. Step 2: Compare options with terminal use

    Watching videos, browsing internet, and playing music are done with other apps, not the terminal.
  3. Final Answer:

    To type commands to control the computer -> Option A
  4. Quick Check:

    Terminal = command control [OK]
Hint: Terminal is for commands, not media [OK]
Common Mistakes:
  • Thinking terminal is for media
  • Confusing terminal with GUI apps
  • Not knowing terminal controls computer
2. Which of the following commands correctly opens a new terminal window in most Linux desktop environments?
easy
A. gnome-terminal
B. open-terminal
C. start-terminal
D. launch-term

Solution

  1. Step 1: Identify common terminal commands

    The command gnome-terminal is the standard way to open a terminal window in GNOME desktop.
  2. Step 2: Check other options

    Commands like open-terminal, start-terminal, and launch-term are not standard Linux commands.
  3. Final Answer:

    gnome-terminal -> Option A
  4. Quick Check:

    Standard terminal command = gnome-terminal [OK]
Hint: Remember GNOME uses gnome-terminal command [OK]
Common Mistakes:
  • Typing non-existent commands
  • Confusing Windows commands with Linux
  • Using wrong command names
3. What will be the output of the command pwd immediately after opening a new terminal?
medium
A. /usr/bin
B. /root
C. /etc
D. /home/username

Solution

  1. Step 1: Understand what pwd does

    The pwd command shows the current directory path.
  2. Step 2: Know the default directory on terminal open

    When a user opens a terminal, it usually starts in their home directory, like /home/username.
  3. Final Answer:

    /home/username -> Option D
  4. Quick Check:

    New terminal starts in home directory [OK]
Hint: New terminal starts in your home folder [OK]
Common Mistakes:
  • Assuming root or system folders
  • Not knowing pwd shows current folder
  • Confusing with other commands
4. You typed ls -l but got an error: ls: command not found. What is the most likely cause?
medium
A. You are not in the home directory
B. You need to use list -l instead
C. The ls command is not installed or PATH is broken
D. You forgot to open the terminal

Solution

  1. Step 1: Understand the error message

    The error command not found means the system cannot find the ls command.
  2. Step 2: Identify common causes

    This usually happens if the command is missing or the PATH environment variable is broken.
  3. Final Answer:

    The ls command is not installed or PATH is broken -> Option C
  4. Quick Check:

    Command not found = missing command or PATH issue [OK]
Hint: Command not found means missing or PATH error [OK]
Common Mistakes:
  • Thinking directory location matters
  • Using wrong command names
  • Ignoring terminal must be open
5. You want to open a terminal and immediately list all files in your Documents folder. Which command should you use?
hard
A. open-terminal ls Documents
B. gnome-terminal -- bash -c "ls ~/Documents"
C. start-terminal -list ~/Documents
D. terminal ls -all Documents

Solution

  1. Step 1: Understand how to open terminal and run a command

    The command gnome-terminal -- bash -c "ls ~/Documents" opens a terminal and runs ls ~/Documents.
  2. Step 2: Check other options for correctness

    Other options use invalid commands like open-terminal, start-terminal, or wrong syntax.
  3. Final Answer:

    gnome-terminal -- bash -c "ls ~/Documents" -> Option B
  4. Quick Check:

    Open terminal and run command = gnome-terminal -- bash -c [OK]
Hint: Use gnome-terminal with bash -c to run commands [OK]
Common Mistakes:
  • Using non-existent commands
  • Wrong syntax for running commands
  • Not quoting commands properly
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard