Skip to content
Go back

RHEL Intensive – Linux Fundamentals A Beginner-Friendly Guide

Edit page

🎯 Hey there! If you’re new to Linux or just brushing up on RHEL fundamentals, this guide is for you. We’ll break everything down step by step, with plenty of theory, examples, and tips to make it all click. No prior experience needed – let’s make Linux fun and approachable!


Linux

Table of Contents

Open Table of Contents

📂 Understanding the Linux File System

Imagine your computer’s storage as a big family tree – that’s basically the Linux file system! It starts at the very top with the root directory, written as /. Everything else branches out from there, like folders inside folders. This structure keeps things organized and helps the system find files quickly.

Why is this important? In Linux (and RHEL, which is a popular version of Linux used in businesses), knowing where files live makes troubleshooting and managing your system way easier. For beginners, think of it like navigating a house: the kitchen (/home) is where you keep personal stuff, the basement (/etc) has all the setup tools, and so on.

Here are some key directories explained simply:

Every file and folder also has permissions, which we’ll dive into soon. They decide who can read, change, or run things. This setup makes Linux secure and efficient, unlike Windows where things might feel more scattered.

Beginner Tip: Use the tree command (install it if needed with sudo yum install tree on RHEL) to visualize the structure: tree / (but be ready, it’s a big tree!).

Linux File System

Links in Linux are like shortcuts or aliases for files, but they come in two flavors: hard and soft (symbolic). Why use them? They save space, organize files without duplicating data, and make it easier to access stuff from different places. Think of them as pointers – hard links are like extra names for the same file, while soft links are like bookmarks.

A hard link points straight to the file’s data on the disk. If you delete the original, the hard link still works because it’s essentially the same file with multiple names.

Theory Bit: In Linux, files are identified by inodes (unique numbers). Hard links share the same inode, so they’re equals.

Example for Beginners:

echo "Hello World" > original.txt  # Create a file
ln original.txt hardlink.txt       # Make a hard link
cat hardlink.txt                   # Outputs "Hello World"
rm original.txt                    # Delete original
cat hardlink.txt                   # Still works!

A soft link points to the file’s path, like a desktop shortcut. If the original moves or deletes, the link breaks (dangling link).

Theory Bit: Soft links have their own inode and just store the path to the target.

Example:

ln -s original.txt softlink.txt    # -s for symbolic
rm original.txt                    # Now softlink.txt is broken

Helpful Tip: Use soft links for convenience, like linking a config file to an easy spot. Hard links? Great for backups where you want data to survive deletions.


🔒 File Permissions & Ownership: Controlling Access Like a Pro

Permissions are Linux’s way of saying, “Who can do what to this file?” It’s a security feature to prevent accidents or unauthorized changes. Every file has an owner (usually who created it), a group (for sharing with teams), and “others” (everyone else).

Ownership Basics

To see ownership: ls -l file.txt shows something like rw-r--r-- 1 alex users ... file.txt (alex owns it, group is users).

Permissions Explained (RWX)

Permissions are in threes: read (r), write (w), execute (x). No permission? It’s a dash (-).

For directories: r = list contents, w = create/delete inside, x = enter the folder.

Example Breakdown:

drwxr-xr--  # d = directory, rwx for owner, r-x for group, r-- for others

Changing Things

Octal System (Easy Math): Each set (owner/group/others) is a number from 0-7:

Table for Clarity:

PermissionBinaryDecimalWhat It Means
---0000No access at all
—x0011Can execute/run
-w-0102Can write/edit
-wx0113Write and execute
r—1004Can read/view
r-x1015Read and execute (common for scripts)
rw-1106Read and write
rwx1117Full access

Example: chmod 754 file.txt = Owner full (7), group read/execute (5), others read (4).

Letter Way (More Intuitive for Beginners):

chmod u+rwx file.txt  # u=user/owner, +add rwx
chmod g-r file.txt    # g=group, -remove read
chmod o= file.txt     # o=others, =set to nothing
chmod a+x file.txt    # a=all, +execute for everyone

Beginner Advice: Start with ls -l to check, then chmod. Always test on non-critical files! If you’re root (admin), you can override, but that’s risky.


🔐 Advanced Permissions & ACL: Taking Security to the Next Level

Standard permissions are great, but sometimes you need more control. Enter chattr for file attributes and ACL (Access Control Lists) for fine-tuned access.

chattr: Extra Protection Layers

This adds flags that even root can’t ignore easily. It’s like locking a file in a safe.

Why Use It? Protect important files from accidental deletes or changes, especially in servers.

Key Attributes:

AttributeWhat It DoesUse Case
+iImmutable: Can’t delete, rename, or editLock config files
+aAppend-only: Add data but no editsSecure logs
+uUndeletable: Recover after deleteSafety net for data
+sSecure delete: Wipes data on deletePrivacy
+dNo backup: Skip in dumpsTemp files

Examples:

Theory: These are extended attributes stored in the filesystem, beyond basic perms.

ACL with setfacl: Share with Specific People

ACL lets you give permissions to extra users/groups without changing ownership.

Why? In teams, one file might need different access for different people.

Basics:

More Examples:

Tip for Newbies: ACL builds on chmod – use when basic perms aren’t enough. Install acl package if needed: sudo yum install acl.


💾 Linux Filesystem & Storage Commands: Managing Your Data

Storage in Linux is about partitions (slicing your drive), filesystems (formatting them), and mounting (attaching them). It’s like organizing a closet: divide spaces, label them, and hang things up.

Theory Overview: Disks are raw hardware (/dev/sda). You partition them, format with a filesystem (ext4 is common in RHEL for reliability), then mount to use.

Partitioning: Dividing Your Disk

Tools like fdisk (old-school for MBR) or parted/gdisk (for modern GPT).

Beginner Caution: Backup first! Wrong commands can erase data.

Formatting: Creating Filesystems

Why ext4? It’s RHEL’s default – handles big files, recovers well.

Mounting: Attaching Storage

Checking & Fixing

LVM: Flexible Volumes

LVM lets you resize storage on the fly – great for servers.

Steps:

  1. pvcreate /dev/sda1 (physical volume).
  2. vgcreate myvg /dev/sda1 (volume group).
  3. lvcreate -L 10G -n mylv myvg (logical volume).
  4. Format and mount.

Why LVM? Add/remove disks without downtime.

Swap: Extra Memory

Persistent Mounts with /etc/fstab

This file auto-mounts on boot. Format: device mount-point type options dump fsck.

Example:

UUID=abc-123 /mnt/data ext4 defaults 0 2

Pro Tip: Always backup /etc/fstab – mistakes can make your system unbootable!


🗜️ Compression, Archiving, and Combining Both: Saving Space Smartly

Compression shrinks files (like zipping clothes in a suitcase), archiving bundles them (like packing a bag). Together, they’re perfect for backups or sharing.

Theory: Compression removes redundancy (e.g., repeating patterns). Archiving doesn’t compress but combines for easy handling.

Just Compression

Tip: Use for logs or text – images/videos are already compressed.

Archiving with tar

Combo: Archive + Compress

Why tar.gz? Standard in Linux, portable.

ZIP: Windows-Friendly Alternative

Beginner Hack: For big folders, compress first, then move. Saves time!


💾 Rsync for Backups: Your Reliable Copy Tool

Rsync is like a smart copier – it only transfers changes, making backups fast and efficient. Great for local or remote syncing.

Theory: It compares files by checksums, not just dates, so it’s accurate.

Basic:

rsync -av source/ dest/  # a=archive (keeps perms), v=verbose

Examples:

Helpful Flags: -z for compression during transfer, —delete to mirror deletes.

Tip for Starters: Test with —dry-run to preview changes. Perfect for daily backups!


📊 Process Status (ps) & System Monitoring: Keeping an Eye on Your System

Processes are running programs. Monitoring them helps spot issues like high CPU use.

ps Basics: ps shows snapshots.

Useful Flags Table:

FlagWhat It DoesExample Use
-A/-eAll processesSee everything running
-uUser-specificps -u alex for your stuff
-xNo-terminal processesBackground daemons
-lDetailed infoLong format
-fFull detailsWith commands
—forestTree viewSee parent-child

More Tools:

Process Hunting:

Danger Zone: Fork Bomb :() { :|:& }; : – This spawns endless processes, crashing your system. It’s a demo of recursion gone wrong – don’t run it!

Beginner Strategy: Start with top to watch live, then ps for details. If something’s hogging resources, kill it safely.


🧭 What’s Next?

You’ve got the basics down! Practice on a virtual machine (try VirtualBox with RHEL ISO). Next, explore networking or scripting. If something confuses you, man pages (man command) are your friend. Keep experimenting – Linux gets easier with hands-on play. Questions? Drop a comment!


Edit page
Share this post on:

Previous Post
RHEL Intensive – Network, User, and System Administration: A Beginner’s Guide
Next Post
Geo OSINT Challenge – TRYHACKME Room Write-Up