Bird
Raised Fist0
Intro to Computingfundamentals~20 mins

Linux overview in Intro to Computing - Practice Problems & Coding Challenges

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Challenge - 5 Problems
🎖️
Linux Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What is the primary role of the Linux kernel?

Linux is made up of several parts. One important part is the kernel. What does the Linux kernel mainly do?

AIt stores user files and documents securely on the disk.
BIt manages hardware resources and allows software to communicate with hardware.
CIt is a software application used to browse the internet.
DIt provides a graphical user interface for users to interact with the system.
Attempts:
2 left
💡 Hint

Think about what part of the system controls the CPU, memory, and devices.

trace
intermediate
2:00remaining
Trace the output of a Linux command sequence

Consider the following Linux shell commands executed in order. What will be the output of the last command?

Intro to Computing
mkdir testdir
cd testdir
touch file1.txt
ls
Atestdir
BNo output
Cfile1.txt
DError: Directory not found
Attempts:
2 left
💡 Hint

Think about what each command does step-by-step and what ls shows.

identification
advanced
2:00remaining
Identify the Linux file permission representation

Given the file permission string -rwxr-x--x, which statement is true?

AThe owner can read, write, and execute; the group can read and execute; others can only execute.
BThe owner can read and write; the group can write and execute; others have no permissions.
CThe owner has no permissions; the group can read, write, and execute; others can read only.
DAll users have full read, write, and execute permissions.
Attempts:
2 left
💡 Hint

Break down the permission string into owner, group, and others sections.

Comparison
advanced
2:00remaining
Compare Linux distributions based on package management

Which statement correctly compares package management systems of popular Linux distributions?

ADebian-based distributions use <code>apt</code>, while Red Hat-based distributions use <code>yum</code> or <code>dnf</code>.
BAll Linux distributions use the same package manager called <code>pacman</code>.
CUbuntu uses <code>rpm</code> packages, and Fedora uses <code>deb</code> packages.
DLinux distributions do not use package managers; software must be installed manually.
Attempts:
2 left
💡 Hint

Think about the common package managers for Debian and Red Hat families.

🚀 Application
expert
2:00remaining
Determine the result of a Linux command pipeline

What is the output of this Linux command pipeline?

echo -e "apple\nbanana\napple\ncherry" | sort | uniq -c | sort -nr
AError: Invalid command syntax
B
  1 apple
  1 banana
  1 cherry
C
apple
banana
cherry
D
  2 apple
  1 banana
  1 cherry
Attempts:
2 left
💡 Hint

Break down the pipeline: echo outputs lines, sort orders them, uniq -c counts duplicates, final sort -nr sorts numerically in reverse.

Practice

(1/5)
1. What is Linux primarily known as?
easy
A. A free and open-source operating system
B. A type of hardware device
C. A programming language
D. A web browser

Solution

  1. Step 1: Understand what Linux is

    Linux is an operating system, which means it manages computer hardware and software resources.
  2. Step 2: Identify Linux's key feature

    Linux is free and open-source, meaning anyone can use and modify it without cost.
  3. Final Answer:

    A free and open-source operating system -> Option A
  4. Quick Check:

    Linux = free OS [OK]
Hint: Linux is an OS, not hardware or language [OK]
Common Mistakes:
  • Confusing Linux with hardware
  • Thinking Linux is a programming language
  • Assuming Linux is a software application
2. Which of the following is the correct command to list files in a directory in Linux?
easy
A. list
B. dirlist
C. showfiles
D. ls

Solution

  1. Step 1: Recall basic Linux commands

    The command to list files in Linux is a short, simple command.
  2. Step 2: Identify the correct command

    The correct command is ls, which stands for 'list'. Other options are not valid Linux commands.
  3. Final Answer:

    ls -> Option D
  4. Quick Check:

    List files = ls [OK]
Hint: Remember: 'ls' lists files in Linux [OK]
Common Mistakes:
  • Using Windows command 'dir' instead of 'ls'
  • Typing commands that don't exist in Linux
  • Confusing 'list' as a command
3. What will be the output of the command sequence shown below?
mkdir testfolder
cd testfolder
pwd
medium
A. /home/testfolder
B. /testfolder
C. /home/username/testfolder
D. testfolder

Solution

  1. Step 1: Understand each command

    mkdir testfolder creates a folder named 'testfolder'. cd testfolder moves into that folder. pwd prints the current directory path.
  2. Step 2: Determine the full path

    Assuming the user starts in their home directory (e.g., /home/username), after moving into 'testfolder', pwd will show the full path including the home directory and 'testfolder'.
  3. Final Answer:

    /home/username/testfolder -> Option C
  4. Quick Check:

    pwd after cd testfolder = full path [OK]
Hint: pwd shows full current directory path [OK]
Common Mistakes:
  • Assuming pwd shows only folder name
  • Ignoring starting directory path
  • Confusing mkdir with cd output
4. Identify the error in the following Linux command sequence:
cd /home/user/docs
mkdir newfolder
cd newfolder
ls -l
cd ..
cd newfolder
medium
A. Second 'cd newfolder' will fail if 'newfolder' does not exist
B. No error, commands are correct
C. 'mkdir newfolder' should be 'make newfolder'
D. 'ls -l' is an invalid command

Solution

  1. Step 1: Analyze the command sequence step-by-step

    cd /home/user/docs enters docs. mkdir newfolder creates newfolder inside docs. cd newfolder enters it. ls -l lists contents in long format (valid).
  2. Step 2: Verify the last commands

    cd .. returns to docs where newfolder exists. cd newfolder succeeds. All commands valid, no errors.
  3. Final Answer:

    No error, commands are correct -> Option B
  4. Quick Check:

    Folder created persists after cd .. [OK]
Hint: Trace directory state after each cd/mkdir [OK]
Common Mistakes:
  • Thinking second 'cd newfolder' fails (folder exists)
  • Confusing 'mkdir' with 'make newfolder'
  • Believing 'ls -l' invalid (standard command)
5. You want to create a new directory called projects inside your home directory, then create a file named notes.txt inside it with some text. Which sequence of commands will achieve this correctly?
hard
A. cd ~ mkdir projects cd projects echo "My notes" > notes.txt
B. mkdir projects cd projects cd ~ echo "My notes" > notes.txt
C. cd projects mkdir notes.txt echo "My notes" > notes.txt
D. echo "My notes" > notes.txt mkdir projects cd projects

Solution

  1. Step 1: Navigate to home and create directory

    cd ~ moves to the home directory. mkdir projects creates the 'projects' folder there.
  2. Step 2: Enter the new directory and create file with text

    cd projects moves inside the folder. echo "My notes" > notes.txt creates 'notes.txt' with the text 'My notes'.
  3. Final Answer:

    cd ~ mkdir projects cd projects echo "My notes" > notes.txt -> Option A
  4. Quick Check:

    Create dir then file inside it [OK]
Hint: Create folder first, then file inside it [OK]
Common Mistakes:
  • Creating file before directory exists
  • Using wrong order of commands
  • Trying to create file as directory