Skip to main content

Command Palette

Search for a command to run...

Red Hat Certified System Administrator

Updated
β€’12 min read
Red Hat Certified System Administrator
M

Hey there! I'm currently working as an Associate DevOps Engineer, and I'm diving into popular DevOps tools like Azure Devops,Linux, Docker, Kubernetes,Terraform and Ansible. I'm also on the learning track with AWS certifications to amp up my cloud game. If you're into tech collaborations and exploring new horizons, let's connect!

Day 1: Introduction to RHCSA & Installation

What is RHCSA?

RHCSA stands for Red Hat Certified System Administrator.

Why RHCSA is Important

  • Industry-recognized Linux certification

  • Required for Linux system administration jobs

  • Builds strong foundation in:

    • Linux OS

    • Users & permissions

    • Filesystems

    • Networking

    • Services & processes

  • Useful for DevOps, SysAdmin, Cloud, and Server roles

How We Install Linux for Practice

We do not install Linux directly on our main system. Instead, we use Virtualization.

Virtual Machine (VM)

  • We use VMware (or VirtualBox)

  • A VM allows us to run an OS inside another OS

  • Example:

    • Host OS: Windows

    • Guest OS: RHEL / CentOS / Rocky Linux

Installation Steps (High Level)

  1. Install VMware

  2. Create a new Virtual Machine

  3. Attach Linux ISO file

  4. Allocate:

    • RAM

    • CPU

    • Disk

  5. Install Linux OS inside VM

βœ… This method is safe and widely used for learning and testing


Day 2: Linux Directory Structure & Basic Commands

Root Directory /

Linux has a single root directory /. Everything starts from here.

Important System Directories

DirectoryPurpose
/Root of the filesystem
/rootHome directory of root user
/homeHome directories of normal users
/binEssential user commands (ls, cp, mv)
/sbinSystem/admin commands
/etcConfiguration files
/varLogs, mail, variable data
/tmpTemporary files
/bootBootloader & kernel files

Basic Commands Learned

whoami

➑ Shows current logged-in user

ls

➑ Lists files and directories

cd

➑ Changes directory

Examples:

cd /etc
cd ..
cd ~

Linux Terminal Prompt Explained

Example:

hassan@server1:/home/hassan$
PartMeaning
hassanUsername
server1Hostname
/home/hassanCurrent directory
$Normal user
#Root user

βœ… Correction:

  • $ β†’ normal user

  • # β†’ root (admin) user


Day 3: How Linux OS Boots + File Commands

How Operating System Works (Boot Process)

Correct boot order:

  1. BIOS / UEFI

    • Initializes hardware
  2. Bootloader (GRUB2)

    • Loads the kernel

    • Allows selecting different OS

  3. Kernel

    • Core of OS

    • Manages CPU, memory, devices

  4. init / systemd

    • Starts services
  5. Login Screen

    • OS is ready to use

βœ… Correction:

  • BIOS does not load the OS directly

  • BIOS/UEFI loads the bootloader

  • Bootloader loads the kernel

  • Kernel starts the OS

Multiple OS Concept

  • If multiple OS are installed

  • GRUB menu allows choosing which OS to boot

🧠 One-Line Memory Trick

  • Linux:
    UEFI β†’ GRUB β†’ Kernel β†’ systemd β†’ Services β†’ Ready

  • Windows:
    UEFI β†’ Boot Manager β†’ Kernel β†’ Services β†’ Login β†’ Ready


File Commands

cp source destination

➑ Copy files or directories

Examples:

cp file1 file2
cp -r dir1 dir2
mv source destination

➑ Move or rename files

Examples:

mv file1 /tmp
mv oldname newname

Change Hostname

Temporary:

hostname newname

Permanent (Recommended):

hostnamectl set-hostname newname

Day 4: BIOS vs UEFI, Editors & Practice Tasks

BIOS vs UEFI

BIOSUEFI
Old technologyModern
Slow bootFast boot
MBR partitionGPT partition
Limited disk sizeSupports large disks
Text-basedGUI support

βœ… UEFI is used in modern systems


Text Editors

Linux has command-line editors.

Nano (Easy)

nano file.txt
  • Easy to use

  • Shortcuts shown at bottom

  • Save: CTRL + O

  • Exit: CTRL + X

Vim (Advanced)

vim file.txt

Modes:

  • Normal mode (default)

  • Insert mode β†’ i

  • Command mode β†’ :

Common commands:

i        # insert mode
:w       # save
:q       # quit
:wq      # save and quit
:q!      # quit without saving

Practice Tasks

  • Create files

  • Edit files using nano & vim

  • Copy and move files

  • Rename files

  • Change hostname

  • Navigate directories


βœ… Summary

You learned:

  • RHCSA basics and importance

  • Linux installation using VMware

  • Linux directory structure

  • Basic Linux commands

  • Boot process (BIOS β†’ GRUB β†’ Kernel β†’ OS)

  • BIOS vs UEFI

  • File operations

  • Nano & Vim editors

RHCSA – Class Notes (Day 5 & 6)


Day 5: File and Directory Management

Copying Directories

cp -r source_directory destination_directory
  • -r β†’ recursive (copy directory and all its contents)

  • Example:

cp -r /home/hassan/docs /home/hassan/backup_docs

Deleting Files

rm filename
  • Removes a file
rm -i filename
  • Asks confirmation before deletion

Deleting Directories

rmdir directory_name
  • Removes empty directories only
rm -r directory_name
  • Removes directory and all contents recursively
rm -rf directory_name
  • Removes directory and contents without warning

  • ⚠️ Use carefully! Can delete important data


Wildcard *

  • * is used to represent all files or directories

  • Example:

rm *.txt
  • Deletes all .txt files in current directory

Command Structure

command [options] [arguments]
  • Command β†’ what to do (ls, cp, rm)

  • Options β†’ modify behavior (-l, -r, -f)

  • Arguments β†’ files or directories to operate on

Example:

ls -l /home/hassan

Hidden Files

  • Files starting with . are hidden

  • Create a hidden file:

touch .hiddenfile

Clear Terminal

clear
  • Clears the screen

Creating Directories

mkdir folder_name

Nested Directories

mkdir -p parent_folder/child_folder
  • -p β†’ create parent directories if they don’t exist

Creating Multiple Folders

mkdir folder{1..10}
  • Creates folder1, folder2, … folder10

Creating Multiple Files

touch file{1..10}.txt
  • Creates file1.txt β†’ file10.txt

Viewing Directory Tree

tree directory_name

Day 6: Reading File Content & Searching

View File Content

cat

cat /etc/services
  • Displays entire file content

more

more /etc/fstab
  • Shows file page by page (use space to scroll)

less

  • Better alternative to more

  • Scroll forward/backward

less /etc/fstab

head

head -n 10 /etc/services
  • Shows first 10 lines of file

tail

tail -n 10 /etc/services
  • Shows last 10 lines of file

nl

nl /etc/services
  • Shows file content with line numbers

Search Inside Files – grep

grep "pattern" filename
  • Search for specific text in a file

  • Example:

grep "ftp" /etc/services

With options

  • -i β†’ ignore case

  • -c β†’ show count of matching lines

  • -v β†’ show non-matching lines

  • -n β†’ show line numbers

Example:

grep -i "ftp" /etc/services
grep -c "ssh" /etc/services

Word Count – wc

wc filename
  • Shows lines, words, characters

Options:

  • -l β†’ number of lines

  • -w β†’ number of words

  • -c β†’ number of bytes

  • -m β†’ number of characters

Example:

wc -l /etc/services
wc -w /etc/services

Redirection & Operators

  • Redirect output to a file
ls > file.txt
  • Overwrites file.txt with output of ls

  • Append output to a file

ls >> file.txt
  • Adds output to the end of file.txt

  • Pipes (send output of one command to another)

cat /etc/services | grep ftp

βœ… Correction:

  • > β†’ overwrite

  • >> β†’ append

  • | β†’ pipe (send output to another command)


Summary – Day 5 & 6

You learned:

  • Copying, moving, deleting files and directories

  • Wildcards * for multiple files

  • Command structure (command β†’ options β†’ arguments)

  • Hidden files and creating them

  • Creating folders/files in bulk

  • Reading files (cat, more, less, head, tail, nl)

  • Searching in files (grep with options)

  • Word count (wc)

  • Redirection (>, >>) and pipes (|)

Day 7: Operators in Linux

Linux allows combining commands and controlling execution flow using operators.


1️⃣ Semicolon ;

  • Purpose: Run multiple commands sequentially, regardless of whether previous commands succeed or fail

  • Syntax:

command1; command2; command3
  • Example:
echo "Hello"; ls; pwd
  • Output:

    1. Prints β€œHello”

    2. Lists files

    3. Shows current directory

βœ… Note: Commands run one by one even if one fails.


2️⃣ Single Pipe |

  • Purpose: Sends output of first command as input to second command

  • Syntax:

command1 | command2
  • Example:
cat /etc/services | grep ftp
  • cat prints file β†’ grep filters only lines containing β€œftp”

3️⃣ Double AND &&

  • Purpose: Run second command only if the first command succeeds

  • Syntax:

command1 && command2
  • Example:
mkdir test && cd test
  • Only enters test folder if folder creation succeeds

4️⃣ Single AND &

  • Purpose: Run command in background

  • Syntax:

command &
  • Example:
gedit file.txt &
  • Opens gedit in background, so terminal is free to use

5️⃣ Double Pipe ||

  • Purpose: Run second command only if the first command fails

  • Syntax:

command1 || command2
  • Example:
cd nonexistfolder || echo "Folder does not exist"
  • If cd fails, prints warning

Summary of Operators

OperatorPurpose
;Run commands sequentially, ignore errors
&&Run next command only if previous succeeds
`
&Run command in background
``

User and Group Management

Linux manages users and groups for access control and permissions.


Types of Users

User TypeDescriptionUID
Root userSuper admin, full privileges0
System userUsed by OS services, limited login1–999
Regular userNormal human user, limited privileges1000+

Types of Groups

Group TypeDescription
Root groupAssociated with root user, admin group
System groupFor OS processes and services
Regular groupFor normal users, sharing resources

Commands (Basics)

  • View current user
whoami
  • View groups of a user
groups username
  • View all users
cat /etc/passwd
  • View all groups
cat /etc/group

βœ… Corrections / Clarifications

  1. UID ranges for system vs regular users:

    • System: 1–999

    • Regular: 1000+

  2. Background operator: single & runs command in background, not a chain.

  3. Pipes and logical operators (&&, ||) are different:

    • | β†’ sends output to input

    • && / || β†’ controls execution flow


Examples

# Sequential execution
echo "Start"; ls; echo "End"

# Logical AND
mkdir demo && cd demo

# Logical OR
cd nofolder || echo "Folder not found"

# Background process
gedit file.txt &

# Pipe
cat /etc/services | grep ftp

This covers Day 7 operators + intro to user & group management.

RHCSA Day 8 – User and Group Management

User and group management is a core topic in RHCSA and very important for real-world Linux administration. On Day 8, we focused on creating users, managing passwords, understanding user IDs (UIDs), group IDs (GIDs), and how Linux stores user and group information internally.


1. Adding a New User

To create a new user in Linux, we use the useradd command.

useradd username

Example:

useradd ali

This command:

  • Creates the user

  • Assigns a UID automatically

  • Creates a home directory /home/ali

  • Assigns a default shell

⚠️ By default, the user does not have a password yet.


2. Setting or Changing User Password

To set or change a password, use:

passwd username

Example:

passwd ali

You will be prompted to enter and confirm the password.


3. Checking User ID and Group Information

Check UID and GID

id username

Example:

id ali

Output shows:

  • UID (User ID)

  • GID (Primary Group ID)

  • Secondary groups

Check Current Logged-in User

whoami

4. Types of Users in Linux

Linux has three main types of users:

User TypeDescriptionUID Range
Root UserSuperuser with full access0
System UserUsed by services and processes1–999
Regular UserNormal human users1000+

5. Modifying a User (User Management)

The usermod command is used to modify user properties.

Example: Set Account Expiry Date

usermod -e 2026-12-31 ali

Lock a User Account

usermod -L ali

Unlock a User Account

usermod -U ali

6. Password Aging and Expiry

We can control password policies using chage.

chage username

Example:

chage ali

To view password aging info:

chage -l ali

You can:

  • Set password expiry

  • Force password change

  • Set warning days


7. Users vs Groups

What is a User?

  • An individual account

  • Has its own UID

  • Can log in

What is a Group?

  • Collection of users

  • Used to manage permissions easily

  • Identified by GID

Groups make permission management easier instead of assigning permissions user by user.


8. Adding Groups

groupadd groupname

Example:

groupadd developers

9. Primary and Secondary Groups

Primary Group

  • Each user has one primary group

  • Assigned at user creation

  • Used by default when creating files

Secondary Groups

  • Additional groups a user belongs to

  • Used for extra permissions

Add User to a Secondary Group

usermod -aG groupname username

Example:

usermod -aG developers ali

⚠️ -a is very important. Without it, existing groups will be removed.


10. Checking User and Group Files

Linux stores user and group information in /etc directory.

/etc/passwd

cat /etc/passwd

Contains:

  • Username

  • UID

  • GID

  • Home directory

  • Shell

Passwords are not stored here.


/etc/shadow

cat /etc/shadow

Contains:

  • Encrypted passwords

  • Password expiry info

Only readable by root user.


/etc/group

cat /etc/group

Contains:

  • Group name

  • GID

  • Group members


11. Summary (Day 8)

On Day 8, we learned:

  • How to add users and set passwords

  • How to check UID, GID, and group membership

  • Difference between users and groups

  • Primary vs secondary groups

  • How to add users to groups

  • User modification and password expiry

  • Internal Linux files: /etc/passwd, /etc/shadow, /etc/group

This topic is very important for RHCSA exam and real Linux administration.

More from this blog

DevOps Journey with M Hassan

174 posts

I am writing these blogs because I recently completed a comprehensive DevOps course where I gained in-depth knowledge of the topics mentioned. As I progressed through the course, I realized the importance of having a concise and accessible resource to revise and reinforce my understanding of each topic. Therefore, I decided to create cheat sheets in the form of blog posts. These cheat sheets will not only serve as a handy reference for myself but also benefit others who are also interested in mastering DevOps concepts. By documenting each topic and providing concise explanations, I aim to create a valuable resource that simplifies complex concepts and facilitates hands-on practice. This way, I can solidify my own understanding while helping others on their DevOps journey.