Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
You don’t need to memorize everything. The key skill is knowing how to find information quickly using the system’s own tools.
man Command (Manual Pages)The primary source of documentation for commands, configuration files, and system calls.
man [command_name]man lsb: Page up./keyword: Search forward for a keyword (press n for next match, N for previous).q: Quit the manual.man -k [keyword] to search the manual descriptions.
man -k copy--help OptionA quick and concise summary of a command’s options. Perfect for when you just need a syntax reminder.
[command_name] --helpcp --helphelp Command for Shell BuiltinsSome commands (like cd, echo, alias) are built into the shell itself and don’t have a man page. Use help for these.
help [command_name]help cdtype [command] to see if it’s a builtin, alias, or external file.
type cd → cd is a shell builtininfo CommandAn alternative, often more detailed, documentation system with a hyperlinked structure. Some commands have more comprehensive info pages than man pages.
info [command_name]info lsn (next), p (previous), q (quit).Different tools are suited for different tasks, from quick peeks to real-time monitoring.
| Command | Purpose | RHCSA Use Case |
|---|---|---|
cat | Concatenate and display entire file content. | Viewing short files like /etc/passwd. |
less | View file content page-by-page. Allows searching. | The best tool for reading long files. |
more | Older version of less (page-by-page, but less features). | Similar to less, but less capable. |
head | Display the first few lines (default: 10). | Checking the beginning of a configuration file. |
tail | Display the last few lines (default: 10). | Checking the most recent entries in a log file. |
tail -f | Follow a file in real-time as new lines are added. | Crucial for monitoring live logs. |
tail -f and grepThis is an essential troubleshooting technique.
Ctrl+C.For the RHCSA, you must be proficient in at least one command-line text editor. vim is the most powerful and is highly recommended.
nano – The Simple EditorA straightforward, beginner-friendly editor.
sudo dnf install nano -ynano filename.txtCtrl+O: Save (Output).Ctrl+X: Exit.Ctrl+W: Search.Ctrl+\: Search and replace.vim / vi – The Powerful Editor (RHCSA Default)vim is the default editor on RHEL and a critical skill for the exam. It has modes, which can be confusing at first but are incredibly efficient.
sudo dnf install vim -y (Often pre-installed).vim filename.shvim Modesi to enter Insert Mode.: to enter Command-Line Mode.Esc to return to Normal Mode.:.| Task | Command | Mode |
|---|---|---|
| Enter Insert Mode | i | Normal -> Insert |
| Return to Normal Mode | Esc | Insert -> Normal |
| Save (Write) | :w | Command-Line |
| Quit | :q | Command-Line |
| Save and Quit | :wq | Command-Line |
| Quit without Saving | :q! | Command-Line |
| Search | /keyword (then press n/N) | Normal |
Example Workflow for Creating a Script with vim:
# 1. Create and open the file vim backup.sh # 2. Press 'i' to enter Insert Mode. # 3. Type the script: #!/bin/bash tar -czf /root/backup.tar.gz /etc echo "Backup complete." # 4. Press 'Esc' to return to Normal Mode. # 5. Type ':wq' and press Enter to Save and Quit. # 6. Make the script executable and run it. chmod +x backup.sh ./backup.sh
gedit – The Graphical EditorA simple GUI text editor, useful if you have a desktop environment.
sudo dnf install gedit -ygedit filename.txt & (The & runs it in the background).Ctrl+S (Save), Ctrl+Q (Quit).[command] --help.man [command].cat [file].less [file].tail -f [logfile] | grep [keyword].vim [file].