Skip to content

Day 1 Lab Workbook: Introduction to Linux and RHEL


1. Lab Overview

Item Detail
Lab title Exploring a RHEL system and reaching your practice lab
Objective Identify the main parts of a Linux system with read-only commands, compare GUI and CLI work, and operate your hosted lab
Skills tested Identifying the OS, kernel, shell, and user; navigating the terminal; mapping commands to system layers; starting and stopping a lab
Estimated time 45 to 60 minutes
Difficulty Beginner
Required environment The hosted course lab, or any RHEL (or RHEL-compatible) VM with a terminal
Prerequisites Day 1 notes read; a Red Hat account if you use the hosted lab

2. Lab Environment and Safety

Requirements

  • A RHEL-compatible system you are allowed to use for practice. The hosted course lab qualifies.
  • A normal user account. Some tasks switch to root only if your lab provides that, and none of the tasks require it.

Assumptions (not verified for your environment)

  • Your lab provides a terminal. If your lab is GUI-only, open the Terminal application.
  • Your hosted-lab portal looks similar to the one described in the notes. Labels may differ.

Safety

  • Every command in the tasks is read-only, except for creating a practice directory in your home directory.
  • Do not run these tasks on a production system.
  • If a command fails, read the error message before retrying.

3. Practice Tasks

Work through the tasks in order. Try each one without looking at the notes first. Solutions are at the end of this document.

Task 1: Identify the system

Scenario: A colleague asks you to confirm which operating system and kernel a lab machine is running, and which account you are using.

Requirements:

  • Find out your current user name.
  • Find the operating system's name and version.
  • Find the kernel release that is running.
  • Record all three in a text file named day1-report.txt in your home directory.

Hints:

  • Three separate commands answer the three questions.
  • A text file can be created with an editor or with output redirection.

Success criteria: cat ~/day1-report.txt shows the user name, OS name and version, and kernel release, all matching what the individual commands report.


Task 2: Map commands to layers

Scenario: You are explaining the structure of Linux to a new team member and want to show that each layer can be inspected.

Requirements:

  • For each layer below, run one command that reveals information about it and note the command:
  • Hardware
  • Kernel
  • Shell
  • User
  • Operating system
  • Write the layer-to-command pairs in your report file.

Hints:

  • Review the "Mapping commands to layers" example in the notes.
  • Hardware has more than one possible command (processor, memory, disks).

Success criteria: Your report lists five layers, each with a command that you actually ran and understood.


Task 3: Explore your shell

Scenario: You need to confirm which shell you use and which shells the system accepts for login.

Requirements:

  • Show the path of your login shell.
  • List the shells the system considers valid.
  • Confirm that your login shell appears in that list.

Hints:

  • One value comes from a variable, the other from a file under /etc.

Success criteria: You can state the path of your shell and point to it within the list of valid shells.


Task 4: Look around the file system

Scenario: Before administering a server, you want to see how its top-level layout looks and where your account lives.

Requirements:

  • Print your current directory.
  • List the top-level directories of the file system.
  • Move to the top-level directory and back to your home directory using only cd commands.
  • Confirm you are back in your home directory.

Hints:

  • cd with no argument returns you home.
  • The root of the file system is a single character.

Success criteria: pwd shows your home directory at the end, and you can name at least three directories you saw in the listing.


Task 5: Compare GUI and CLI

Scenario: You will later create dozens of directories, so you want to know which interface will work better.

Requirements:

  • In the graphical desktop (if your lab has one), create a folder named gui-folder in your home directory.
  • In the terminal, create a directory named cli-folder in your home directory.
  • Confirm that both exist from the terminal.
  • Write two sentences in your report explaining which approach scales better, and why.

Hints:

  • If your lab has no desktop, create only cli-folder and describe how you expect the GUI process to differ.

Success criteria: A listing of your home directory shows the folder(s) you created, and your two sentences are in the report.


Task 6: Operate your hosted lab

Scenario: You will use the hosted lab throughout the course, so you must be able to control it yourself.

Requirements:

  • Log in to the course portal.
  • Find your course and its lab.
  • Note the lab's access end date (use the lab extension date, not the class end date).
  • Create the lab (if it does not already exist), start it, stop it, and start it again.

Hints:

  • If the lab does not appear, note the instructor or account name shown in the portal and contact your course provider.

Success criteria: You started and stopped the lab without help and recorded the end date in your report.


4. Troubleshooting Challenges

All challenges are safe and read-only.

Challenge A: The command that will not run

A student types the following commands and gets errors.

Cat /etc/os-release
ls /ect
uname -R

Your job: Explain what is wrong with each command, fix each one, and run the corrected versions.

Success criteria: All three corrected commands run without errors, and you can explain the cause of each mistake.

Challenge B: The missing lab

A classmate logged in to the portal but sees no lab for the course.

Your job: List three things to check or collect before asking for help, and describe what information to send to the course provider.

Success criteria: Your list includes the account used to log in, the course shown in My Training, and the instructor name displayed.


5. Final Practical Challenge

Scenario: You have been handed a lab machine with no documentation. Produce a one-page system profile that a colleague could use to understand it.

Requirements: Create ~/system-profile.txt that contains:

  1. Current user and login shell.
  2. Operating system name and version.
  3. Kernel release and machine architecture.
  4. Hostname.
  5. Number of processors and total memory (read from the system, not guessed).
  6. The names of the top-level directories of the file system.
  7. A short paragraph (two to four sentences) explaining, in your own words, which layer each of items 1 to 5 belongs to.

You must work out which commands to use. Do not copy the commands from the notes without understanding their output.

Success criteria: Every value in the file matches what the system reports when you run the commands again, and the paragraph correctly names the layers.


6. Verification Checklist

  • [ ] I identified my user, OS, kernel, and shell.
  • [ ] I mapped at least five layers to commands I ran.
  • [ ] I confirmed my login shell appears in the list of valid shells.
  • [ ] I navigated the file system and returned to my home directory.
  • [ ] I created at least one directory from the CLI and confirmed it.
  • [ ] I started, stopped, and restarted the hosted lab and noted its end date.
  • [ ] I fixed all three commands in Challenge A.
  • [ ] My system-profile.txt matches fresh command output.

7. Solutions and Answer Key

Try the tasks before reading this section. Command output depends on your system, so expected results below describe what to look for rather than exact text.

Task 1 solution

Approach: Run one command per fact, then write the results to a file.

whoami
cat /etc/os-release
uname -r

To create the report with output redirection:

{ echo "User:"; whoami; echo; echo "OS:"; grep PRETTY_NAME /etc/os-release; echo; echo "Kernel:"; uname -r; } > ~/day1-report.txt
cat ~/day1-report.txt

Explanation: The braces group several commands so their combined output is written once. > replaces the file if it exists, so use >> to append. grep PRETTY_NAME selects the single line that describes the OS and version.

Verification: cat ~/day1-report.txt shows all three facts, and each matches the individual commands.

Cleanup: rm ~/day1-report.txt if you no longer need it. Only delete files you created.


Task 2 solution

Layer Example command
Hardware lscpu (also free -h, lsblk)
Kernel uname -r
Shell echo $SHELL
User whoami
Operating system cat /etc/os-release

Append your pairs to the report file with an editor, or use >> with echo.

Verification: You ran every command and can explain what its output tells you.


Task 3 solution

echo $SHELL
cat /etc/shells

Explanation: $SHELL holds the path of your login shell. /etc/shells lists valid login shells. On RHEL the login shell is normally /bin/bash.

Verification: The path printed by the first command is one of the lines in the second output.


Task 4 solution

pwd
ls /
cd /
pwd
cd
pwd

Explanation: cd / changes to the root of the file system. cd alone returns to your home directory.

Verification: The final pwd shows your home directory (for example /home/<your-user>). Typical top-level names you may see include bin, boot, dev, etc, home, root, usr, and var, but your listing is the authority.


Task 5 solution

mkdir ~/cli-folder
ls ~

Create gui-folder in the file manager if a desktop is available.

Explanation: The CLI approach scales because commands can be repeated, scripted, and run remotely. For example, mkdir can create many directories in one command.

Verification: ls ~ lists the folder(s). Remove the practice folders when you are done:

rmdir ~/cli-folder

rmdir removes only empty directories, which makes it a safe choice here.


Task 6 solution

  1. Open the portal at rol.redhat.com and log in.
  2. Open My Training, then the course.
  3. Locate the lab extension date and record it.
  4. Click Create if the lab is not yet built, then wait several minutes.
  5. Use the lab controls to start, stop, and start again.

Verification: The lab shows as running after the final start. If the lab is missing, provide your account name, the course shown, and the instructor name to your course provider.


Challenge A solution

Command Problem Fix
Cat /etc/os-release Commands are case-sensitive; Cat does not exist cat /etc/os-release
ls /ect Typo in the directory name ls /etc
uname -R Options are case-sensitive; -R is not the intended option uname -r

Verification: Run the three corrected commands. Each prints output without an error.

Challenge B solution

Check or collect: the account email used to log in, the course name shown in My Training, the instructor name shown in the portal, whether the lab extension date has passed, and a screenshot of what you see. Send these to your course provider.


Final practical challenge solution

{
  echo "User and shell:"; whoami; echo "$SHELL"; echo
  echo "OS:"; grep PRETTY_NAME /etc/os-release; echo
  echo "Kernel and architecture:"; uname -r; uname -m; echo
  echo "Hostname:"; hostname; echo
  echo "Processors:"; nproc; echo
  echo "Memory:"; free -h; echo
  echo "Top-level directories:"; ls /; echo
} > ~/system-profile.txt

Then append a paragraph with an editor. For example, state that the user and shell belong to the user and shell layers, the OS name to the operating system layer, the kernel release to the kernel layer, and the processor count and memory to the hardware layer. (The hostname is an identity setting of the operating system.)

Explanation: nproc prints the number of processing units available, and free -h shows memory in readable units. Grouping the commands in braces writes everything to a single file.

Verification: Re-run the commands and compare. Open the file with cat ~/system-profile.txt.

Cleanup: rm ~/system-profile.txt ~/day1-report.txt when you are finished (these are files you created).


8. Extended Practice Drills

Short, independent drills for repeated practice. Do them in order or jump to the group you need. Work only inside your lab directory, read each drill carefully, and check your result with a command before looking at the answer list in section 9.

Setup (run once):

mkdir -p ~/day1-lab && cd ~/day1-lab

A. Concepts (answer in your own words)

  1. Define an operating system in one sentence.
  2. What does "open source" mean? Give two things it allows.
  3. Explain the difference between the Linux kernel and a Linux distribution.
  4. Who created the Linux kernel, and in which year?
  5. Name the six layers of a Linux system from bottom to top.
  6. What does the shell do when you type a command?
  7. Give two differences between a GUI and a CLI.
  8. Name three places Linux is used besides desktops.
  9. List the five layered security controls from the notes.
  10. Name three Linux distributions and one use for each.
  11. What is the difference between RHEL and a free distribution in terms of support?
  12. Put RHCSA, RHCE, and RHCA in order and state what the first two cover.

B. Identify the system

  1. Print your user name.
  2. Print your user ID, group ID, and groups.
  3. Print the OS name and version using the file that describes it.
  4. Print only the single line that gives the human-readable OS name.
  5. Print the running kernel release.
  6. Print the machine architecture.
  7. Print all kernel and system information on one line.
  8. Print the hostname with two different commands.
  9. Show how long the system has been running.
  10. Print the current date and time.

C. Shell and environment

  1. Print the path of your login shell.
  2. List the valid login shells.
  3. Print your home directory using a variable.
  4. Print your user name using a variable.
  5. Find where the bash program is located.
  6. Run a command that clears the screen.
  7. Show your recent command history.
  8. Type uname partially, press Tab to complete, and then run it. Describe what happened.

D. Hardware layer views

  1. Show processor information.
  2. Show the number of processing units available.
  3. Show memory in human-readable units.
  4. Show block devices (disks).

E. First file system steps

  1. Print your current directory.
  2. List the top-level directories of the file system.
  3. Make a directory named practice.
  4. List your current directory to confirm it exists.
  5. Move into practice and print your location.
  6. Return to your home directory with a single short command.
  7. Make a long listing of /.
  8. Remove the empty practice directory safely.
  9. Open the manual page for ls, search for -l, then quit.

F. Mapping and troubleshooting

  1. For each command, name its layer: lscpu, uname -r, echo $SHELL, whoami, cat /etc/os-release.
  2. Fix this command: Cat /etc/os-release.
  3. Fix this command: ls /ect.
  4. Fix this command: uname -R.
  5. Explain "No such file or directory" and name two checks.
  6. Explain "Permission denied" and one safe response.
  7. Write a short system profile (user, OS, kernel, hostname, CPUs, memory) in ~/day1-lab/profile.txt.

9. Drill Answer Key

Answers show one valid approach. Output varies by system, so compare the meaning of your output, not exact text. Commands marked with sudo need elevated privileges.

A. Concepts (answer in your own words)

  1. Software that manages hardware and provides services so users and programs can use the machine.
  2. The source code is available. You may use, study, modify, and share it under its license.
  3. The kernel is the core that manages hardware, memory, and processes. A distribution packages the kernel with tools, libraries, a package manager, and applications.
  4. Linus Torvalds, in 1991.
  5. Hardware, operating system, kernel, shell, applications, user.
  6. It interprets the command, has it carried out through the kernel, and shows the result.
  7. GUI: mouse and windows, easier for beginners. CLI: typed commands, faster for repeated tasks, scriptable, works well over remote connections.
  8. Any three of: servers, cloud VMs, Android phones, routers and switches, firewalls, embedded devices, supercomputers.
  9. File permissions, special permissions, ACLs, SELinux, firewall.
  10. Example: RHEL (enterprise servers), Ubuntu (desktops and servers), Kali (security testing).
  11. RHEL subscriptions include official updates, repository access, and a support channel. Free distributions generally rely on the community.
  12. RHCSA (system administration), then RHCE (Ansible automation), toward RHCA (architect level, after multiple certifications).

B. Identify the system

  1. whoami
  2. id
  3. cat /etc/os-release
  4. grep PRETTY_NAME /etc/os-release
  5. uname -r
  6. uname -m
  7. uname -a
  8. hostname and hostnamectl
  9. uptime
  10. date

C. Shell and environment

  1. echo $SHELL
  2. cat /etc/shells
  3. echo $HOME
  4. echo $USER
  5. which bash
  6. clear
  7. history
  8. Typing unam then Tab completes the name. Tab completion saves typing and avoids typos.

D. Hardware layer views

  1. lscpu
  2. nproc
  3. free -h
  4. lsblk

E. First file system steps

  1. pwd
  2. ls /
  3. mkdir practice
  4. ls
  5. cd practice then pwd
  6. cd (or cd ~)
  7. ls -l /
  8. rmdir practice (works only on empty directories)
  9. man ls, then type /-l and Enter, press n for next match, q to quit.

F. Mapping and troubleshooting

  1. Hardware, kernel, shell, user, operating system.
  2. Commands are case-sensitive: cat /etc/os-release.
  3. The directory is /etc: ls /etc.
  4. Options are case-sensitive: uname -r.
  5. The path does not exist or is mistyped. Check with pwd and ls, and use Tab completion.
  6. You lack the needed permission. Confirm who you are with whoami and use sudo only if the task truly needs it.
  7. Use the commands above and redirect with > for the first item and >> for the rest, then cat ~/day1-lab/profile.txt.