StudyToCert

All certifications / RHCSA / Lessons

Red Hat Certified System Administrator EX200 (RHEL 10) · Domain 1: Understand and use essential tools

Using a shell prompt and running commands with correct syntax

▶ Watch the overview video

Last reviewed September 25, 2026 · Leer en español

Almost everything on the RHCSA exam happens at a shell prompt. The shell (on Red Hat Enterprise Linux, RHEL, this is Bash, the Bourne Again SHell) reads a line you type, splits it into words, expands special characters and then runs a program. Knowing exactly how it does that is what separates a command that works from one that silently does the wrong thing on a live exam system.

The prompt itself tells you who and where you are. A typical RHEL prompt looks like [student@servera ~]$: the user name, the short host name, the current directory (~ means your home directory) and a final character that is $ for a normal user and # for root. Before you change anything on the exam, glance at the prompt so you know which machine and which account you are on.

A command line has a simple structure: the command name, then options, then arguments. Options change how the command behaves and usually start with a dash. Short options are single letters and can be grouped, so ls -l -a -h is the same as ls -lah. Long options start with two dashes and are spelled out, such as ls --all. Arguments are what the command acts on, usually file names. Spaces separate words, which is why a file name containing a space must be quoted ('my file') or escaped with a backslash.

ls -lah /etc/ssh          # command, grouped options, one argument
cp --verbose a.txt b.txt   # long option, two arguments
command1 ; command2        # run one after the other
sleep 300 &                # run in the background

The shell expands several things before the program ever sees them. Globs such as *.conf become the list of matching file names, ~ becomes your home directory, $HOME becomes the value of a variable and $(date) becomes a command's output. Because the shell does this, rm *.log and rm a.log b.log are identical from the point of view of rm. Use echo in front of a risky command (echo rm *.log) to preview what the expansion will produce.

Bash also saves effort. Tab completes command and file names and shows the choices when you press it twice, which avoids typos in long paths. The Up arrow and history recall earlier commands, Ctrl+R searches them, and Ctrl+C interrupts a running command. type tells you whether a word is a built-in, an alias or a program, and which shows the path of a program found through your PATH variable.

Finally, remember that Linux is case-sensitive: File.txt and file.txt are different files, and -R and -r can be different options. When a command fails, read the error message; it usually names the word it could not understand.

Key terms

Shell
The program (Bash on RHEL) that reads your command lines, expands them and starts the requested programs.
Option
A word beginning with - or -- that changes how a command behaves, such as -l or --all.
Argument
A word after the options that the command acts on, usually a file or directory name.
Glob
A wildcard pattern such as *.conf or file?.txt that the shell expands into matching file names.
Tab completion
Pressing Tab to have Bash finish a command or path name, reducing typing errors.
Real-world example

An exam task asks you to list every file in /etc/ssh including hidden ones with human-readable sizes. You check the prompt to confirm you are on servera, type ls -lah /etc/ssh, and use Tab to complete the path so a typo cannot send you to the wrong directory.

Exam tip: The shell, not the command, expands globs, variables and ~. If a result surprises you, put echo in front of the command to see exactly which arguments the program will receive.

Check yourself

What does the # at the end of a prompt usually indicate?

You are logged in as root; a normal user's prompt ends in $.

Are ls -la and ls -l -a different?

No. Short options can be grouped behind a single dash, so both give a long listing including hidden files.

How do you pass a file named my report.txt to a command?

Quote it ('my report.txt') or escape the space (my\ report.txt) so the shell treats it as one argument.

Study RHCSA for free
A week-by-week plan with every lesson, quizzes, checkpoint tests, a practice exam and hands-on labs.
Open the RHCSA study plan