Bird
Raised Fist0
Linux CLIscripting~10 mins

Opening and using the terminal in Linux CLI - Interactive Code Practice

Choose your learning style10 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the command to open the terminal on most Linux systems.

Linux CLI
[1]
Drag options to blanks, or click blank then click option'
Aterminal
Bopen-terminal
Cstart-terminal
Dgnome-terminal
Attempts:
3 left
💡 Hint
Common Mistakes
Typing 'open-terminal' or 'start-terminal' which are not valid commands.
Using just 'terminal' which is not a command.
2fill in blank
medium

Complete the command to list files and folders in the current directory.

Linux CLI
[1]
Drag options to blanks, or click blank then click option'
Ashow
Bls
Cdir
Dlist
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'list' or 'show' which are not valid Linux commands.
Using 'dir' which works in Windows but is less common in Linux.
3fill in blank
hard

Fix the error in the command to change directory to the home folder.

Linux CLI
cd [1]
Drag options to blanks, or click blank then click option'
A~
B/home
C/root
Dhome
Attempts:
3 left
💡 Hint
Common Mistakes
Typing 'cd home' without slash which causes an error.
Using '/root' which is not the regular user's home.
4fill in blank
hard

Fill both blanks to create a command that shows the current directory path and lists its contents.

Linux CLI
[1] && [2]
Drag options to blanks, or click blank then click option'
Apwd
Bls
Ccd
Decho
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'echo' instead of 'pwd' to show directory.
Using 'cd' which changes directory instead of showing it.
5fill in blank
hard

Fill all three blanks to create a command that creates a new directory named 'projects', changes into it, and lists its contents.

Linux CLI
[1] projects && [2] projects && [3]
Drag options to blanks, or click blank then click option'
Amkdir
Bcd
Cls
Drmdir
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'rmdir' which deletes directories instead of creating.
Mixing order of commands causing errors.

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