Study guide
2.1 Shell Prompt and Command Syntax
Red Hat Certified System Administrator RHCSA
Track your progress as you read
Finished sections get a check mark.
1 Introduction & Exam Overview
1.1 Current Exam Facts 1.2 Lab Setup & Performance-Based Study Strategy
2 Essential Tools: Shell, Redirection & Text Analysis
2.1 Shell Prompt and Command Syntax 2.2 Input-Output Redirection and Pipes 2.3 grep and Regular Expressions for Text Analysis
3 Essential Tools: Remote Access, Users & Text Editing
3.1 Access Remote Systems Using SSH 3.2 Log In and Switch Users in Multiuser Targets 3.3 Create and Edit Text Files
4 Essential Tools: Files, Links & Archives
4.1 Create, Delete, Copy, and Move Files and Directories 4.2 Hard and Soft Links 4.3 Archive and Compress with tar, gzip, and bzip2
5 Essential Tools: Permissions & System Documentation
5.1 List, Set, and Change Standard ugo/rwx Permissions 5.2 System Documentation: man, info, and /usr/share/doc
6 Manage Software: RPM and Flatpak
6.1 Configure Access to RPM Repositories 6.2 Install and Remove RPM Software Packages 6.3 Configure Access to Flatpak Repositories 6.4 Install and Remove Flatpak Software Packages
7 Create Simple Shell Scripts
7.1 Conditional Execution: if, test, and [] 7.2 Looping Constructs for Files and Input 7.3 Process Script Inputs ($1, $2, and Beyond) 7.4 Process Shell Command Output in Scripts
8 Operate Running Systems: Boot and Recovery
8.1 Boot, Reboot, and Shut Down a System Normally 8.2 Boot Systems into Different Targets Manually 8.3 Interrupt the Boot Process to Gain Access
9 Operate Running Systems: Processes and Tuning
9.1 Identify and Kill CPU/Memory Intensive Processes 9.2 Adjust Process Scheduling 9.3 Manage Tuning Profiles
10 Operate Running Systems: Logs, Services & File Transfer
10.1 Locate and Interpret System Log Files and Journals 10.2 Preserve System Journals 10.3 Start, Stop, and Check Status of Network Services 10.4 Securely Transfer Files Between Systems
11 Configure Local Storage: Partitions and LVM
11.1 List, Create, and Delete Partitions on GPT Disks 11.2 Create and Remove Physical Volumes 11.3 Assign Physical Volumes to Volume Groups 11.4 Create and Delete Logical Volumes
12 Configure Local Storage: Mounting and Expansion
12.1 Mount File Systems at Boot by UUID or Label 12.2 Add Partitions, Logical Volumes, and Swap Non-Destructively
13 Create and Configure File Systems: Local FS and Permissions
13.1 Create, Mount, and Use VFAT, ext4, and XFS File Systems 13.2 Extend Existing Logical Volumes 13.3 Diagnose and Correct File Permission Problems
14 Create and Configure File Systems: NFS and autofs
14.1 Mount and Unmount Network File Systems Using NFS 14.2 Configure autofs
15 Deploy and Maintain: Scheduling, Services & Targets
15.1 Schedule Tasks with at, cron, and systemd Timers 15.2 Start, Stop, and Enable Services at Boot 15.3 Configure Systems to Boot into a Specific Target
16 Deploy and Maintain: Time, Software Updates & Bootloader
16.1 Configure Time Service Clients 16.2 Install and Update Software from CDN, Remote Repos, and Local Files 16.3 Modify the System Bootloader
17 Manage Basic Networking
17.1 Configure IPv4 and IPv6 Addresses 17.2 Configure Hostname Resolution 17.3 Configure Network Services to Start Automatically at Boot 17.4 Restrict Network Access Using firewalld and firewall-cmd
18 Manage Users and Groups
18.1 Create, Delete, and Modify Local User Accounts 18.2 Change Passwords and Adjust Password Aging 18.3 Create, Delete, and Modify Local Groups and Memberships 18.4 Configure Privileged Access
19 Manage Security: Firewall, umask & SSH Keys
19.1 Configure Firewall Settings with firewall-cmd and firewalld 19.2 Manage Default File Permissions 19.3 Configure Key-Based Authentication for SSH
20 Manage Security: SELinux Modes and Contexts
20.1 Set Enforcing and Permissive Modes for SELinux 20.2 List and Identify SELinux File and Process Contexts 20.3 Restore Default File Contexts
21 Manage Security: SELinux Ports and Booleans
21.1 Manage SELinux Port Labels 21.2 Use Boolean Settings to Modify SELinux Settings
2.1 Shell Prompt and Command Syntax
Key Takeaways Explain This Topic AI
RHEL 10 default interactive shell is bash; the prompt tells you who you are, where you are, and whether you have root privileges ($ vs #).
Command line order is command, options (short -x or long --name), then arguments (paths, names, patterns); getopts-style flags usually come before operands.
Tab completion, history (!!, Ctrl-R), and Ctrl-C / Ctrl-D / Ctrl-Z are exam speed tools—use them deliberately under time pressure.
Absolute paths start at /; relative paths start from $PWD. Always confirm identity with whoami and id before destructive work.
Quote arguments with spaces or shell metacharacters; unquoted * ? [ ] $ ` and similar expand before the command runs.
Last updated: August 2026
2.1 Shell Prompt and Command Syntax
Quick Answer: On RHEL 10, open a terminal or SSH session, confirm you are in bash, read the prompt for user and path, then run command [options] [arguments] with correct quoting and paths. Root sessions usually show # ; regular users show $ .
The EX200 objective Access a shell prompt and issue commands with correct syntax is the first essential-tools skill. Every graded task—editing configs, managing storage, fixing SELinux—starts at a prompt. There is no partial credit for “almost right” syntax; a mistyped path or unquoted space fails the command and burns time.
Opening a Shell on RHEL 10
In the exam VM you typically land in a graphical session or a text console. From the GUI, open Terminal (or press the standard shortcut if available). From a text console, log in with the account the task describes. Remote access is covered later under SSH; locally, you may already be logged in as a normal user and escalate with sudo or su - when a task requires root.
- Confirm the shell and identity immediately: echo $SHELL
- ps -p $$
- whoami
- id
- pwd
$SHELL is the login shell path (often /bin/bash on RHEL). ps -p $$ shows the current process; on exam systems you should see bash . whoami and id print the effective user and groups—critical before changing ownership, writing under /etc , or using privileged tools. pwd prints the working directory; many tasks assume you start in a home directory and navigate deliberately.
- Switch to root only when needed: sudo -i # root login shell via sudo (preferred pattern on modern RHEL)
- su - # root login shell if password policy allows
- exit # leave root shell; return to previous user
Exam trap: Running as root by default makes every typo more dangerous. Prefer a normal user plus sudo for single commands unless the task requires a full root environment (for example, some recovery or multi-step system config work).
- Reading the Prompt
- A typical bash prompt on RHEL looks like: [student@server1 ~]$
- [root@server1 /etc]#
Break it down:
- Prompt piece Meaning
- student / root Current user
- server1 Hostname (short form)
- ~ or /etc Working directory ( ~ means home)
- $ Unprivileged shell
- # Root shell
If the prompt shows # and you thought you were a normal user, stop and re-check whoami before proceeding. If the hostname is wrong, you may be on the wrong machine in multi-VM scenarios—confirm before changing production-like configs.
Customize temporarily for clarity during practice (not required on exam): export PS1='[\u@\h \w]\$ '
\u user, \h hostname, \w full working path, \$ shows $ or # based on UID.
- Command Syntax Anatomy
- Bash parses a simple command as: command [options...] [arguments...]
- Examples: ls
- ls -la /var/log
- ls --all --human-readable /var/log
- cp -a /etc/hosts /tmp/hosts.bak
- systemctl status sshd
Command: the program or shell builtin ( ls , cp , cd , echo ).
Options (flags): modify behavior. Short form is one dash plus letter ( -l , -a ); long form is two dashes ( --all ). Combined short options are common: ls -la equals ls -l -a .
Arguments: operands the command acts on—file paths, usernames, service names, patterns.
Option order matters for some tools but not all. A safe exam habit is options first, then operands : grep -i error /var/log/messages
- # not: grep /var/log/messages -i error (works for grep but confuses habits)
- Many GNU utilities accept -- to mark end of options when an argument looks like a flag: rm -- -weirdfile
- Paths: Absolute vs Relative
- Form Example Resolves from
- Absolute /etc/ssh/sshd_config Filesystem root /
- Relative sshd_config Current directory $PWD
- Home shortcut ~/notes.txt Current user’s home
- Parent ../backup One directory up
- Current ./script.sh Explicit current directory cd /etc
- ls ssh/sshd_config # relative from /etc
- ls /etc/ssh/sshd_config # absolute—works from anywhere
- cd ~
- cd -
cd - returns to the previous directory—useful when alternating between two paths. cd with no argument goes home.
Exam trap: Relative paths fail silently or act on the wrong file when you are not where you think you are. Before long pipelines, run pwd and use absolute paths for critical system files.
Quoting and Metacharacters
The shell expands certain characters before the command runs:
- Character Risk if unquoted
- space Splits one argument into many
- * ? [...] Filename globbing
- $VAR / $(...) Parameter / command substitution
- > >> < | Redirection / pipe (next section)
- ; & Command separators / background
- ` Legacy command substitution
- Quoting rules you need: touch "My Report.txt"
- echo "User is $USER" # double quotes: variables expand
- echo 'User is $USER' # single quotes: literal text
- echo Files: *.conf # glob expands to matching names
- echo 'Files: *.conf' # literal asterisk
Use single quotes when you must protect $ and backticks. Use double quotes when you want expansion but need to protect spaces. Escape a single character with backslash: echo \$HOME prints $HOME .
- Essential Navigation and Inspection Commands
- Memorize these for fluid exam work: pwd # print working directory
- cd /path # change directory
- ls -la # long list including hidden files
- ls -ld /etc # list directory itself, not contents
- file /bin/bash # identify file type
- stat /etc/passwd # inode, permissions, timestamps
- which systemctl # path of executable in $PATH
- type cd # shell builtin vs external command
- hash -r # clear command path cache after PATH changes
type is underrated on RHCSA: it tells you whether a name is a builtin, alias, function, or external binary. If a command “doesn’t work” after installing a package, re-check type and $PATH .
Line Editing, History, and Job Control
Speed matters on a timed performance exam:
- Key / shortcut Effect
- Tab Complete command, option, or path
- Tab Tab List possible completions
- Up / Down arrow Previous / next history line
- Ctrl-R Reverse incremental history search
- !! Re-run last command
- !$ Last argument of previous command
- Ctrl-A / Ctrl-E Start / end of line
- Ctrl-U Kill from cursor to start of line
- Ctrl-C Interrupt running foreground process
- Ctrl-D EOF / logout of interactive shell (empty line)
- Ctrl-Z Suspend job (then bg / fg / jobs ) ls /var/log/messages
- less !$ # less /var/log/messages
- sudo !! # re-run last command with sudo
Exam trap: Ctrl-D on an empty prompt logs you out. If you meant to stop input to a program, ensure you are inside that program’s stdin, not at a bare shell prompt.
Command Exit Status
Every command returns an integer exit status in $? : true; echo $?
false; echo $?
ls /no/such/path; echo $?
0 means success.
Non-zero means failure (exact codes vary by program).
You will use exit status heavily in shell scripting later ( if , && , || ). At the prompt, check $? after a failed command instead of re-running blindly: cp src dest || echo "copy failed with $?"
Practical Scenario: “Configure as User X in Directory Y”
Task wording often assumes:
You are logged in as a specific user (or switch with su - username ).
You work in a named directory under that user’s home or under /home .
Files must be owned by that user unless told otherwise.
- Workflow: whoami
- id
- cd /home/student/project || mkdir -p /home/student/project && cd /home/student/project
- pwd
- touch notes.txt
- ls -l notes.txt
- If ownership is wrong because you created files as root: sudo chown student:student notes.txt
Creating files as root under a user home is a classic exam self-own—fix it before grading yourself.
Common Syntax Mistakes That Cost Points
Spaces around = in assignments — VAR = value runs command VAR ; use VAR=value .
Forgetting spaces in test / [ ] — [ -f file ] needs spaces; covered in scripting chapters.
Wrong dash characters — paste from docs can insert en-dashes; type - yourself.
Assuming Windows paths — RHEL uses / , not \ .
Running GUI-only mental models — there is no “undo” tray; verify with ls , cat , systemctl status after each change.
RHEL 10 Notes
RHEL 10 continues the bash-as-default interactive shell model familiar from RHEL 8/9. Coreutils commands ( ls , cp , mv , chmod , …) behave as GNU tools. Do not rely on non-RHEL aliases from personal laptops ( ll may or may not exist depending on profile). Prefer portable forms: ls -la over assuming ll .
- When documentation is needed at the prompt: man ls
- man bash
- info coreutils 'ls invocation'
System documentation is its own objective later; for this section, know that man 1 command is your syntax source of truth when memory blanks under pressure.
Section Checkpoint
Before leaving this skill, you should be able to open a shell, identify user and path from the prompt, run commands with short and long options, navigate with absolute and relative paths, quote filenames with spaces, recover previous commands from history, and interpret $? after failures. Those habits make every later RHCSA task faster and safer.