Skip to content

Linux (RHEL): A Beginner's Tutorial

Deceema runs on Red Hat Enterprise Linux (RHEL). Linux is the foundation under the files you manage, the software you load, and the Slurm jobs you submit. This hands-on tutorial assumes you have never used Linux before.

By the end, you will be able to:

  • Understand the terminal, shell, commands, and paths.
  • Navigate the Deceema filesystem confidently.
  • Create, inspect, copy, move, search, and organize files.
  • Read Linux ownership and permissions.
  • Measure storage use and inspect your processes.
  • Use Deceema software modules.
  • Complete a small project without risking valuable data.

How to follow this tutorial

Type each command in order. The $ is an example prompt—do not type it. Work only inside the practice directory created below, read commands before pressing Enter, and compare the result with the explanation.

1. Meet the Linux Command Line

When you connect to Deceema, you interact with Linux through a terminal. The terminal displays a shell prompt, accepts commands, and shows their output. This tutorial uses the Bash shell.

Term Meaning
Terminal The interface where you type commands and read output.
Shell The program that interprets those commands.
Prompt The text that indicates the shell is ready for a command.
Command A program or shell operation such as ls.
Option A setting such as -l that changes a command's behavior.
Argument A value the command acts on, such as a filename.
Filesystem The hierarchy of directories and files available to Linux.

Run your first command:

$ printf 'Hello from Deceema\n'
Hello from Deceema

printf is the command. The quoted text is its argument, and \n adds a new line.

Check where and who you are

$ whoami
$ hostname
$ pwd
  • whoami prints your username.
  • hostname identifies the system you are connected to.
  • pwd means print working directory and displays your current location.

Your home directory has the form /hpc/home/$USER, where $USER is replaced by your Deceema username.

Identify RHEL

$ cat /etc/redhat-release
$ uname -r

The first command identifies the RHEL release. The second displays the Linux kernel release. Your exact output may differ as Deceema is updated.

Check whether a command succeeded

Linux commands return an exit status. Zero normally means success; a non-zero value indicates some kind of failure.

$ printf 'Success\n'
$ printf 'Exit status: %s\n' "$?"
Exit status: 0

$? contains the previous command's exit status. Check it immediately because the next command replaces it.

2. Understand Commands and Help

Most commands follow this pattern:

command [options] [arguments]

For example:

$ ls -lh "$HOME"
  • ls lists directory contents.
  • -l requests a detailed or long listing.
  • -h displays sizes in a human-readable format.
  • "$HOME" is the directory to list.

Short options can often be combined: -l -h becomes -lh.

Ask Linux for help

$ man ls

Inside the manual viewer:

  • Press Space to move forward one page.
  • Press b to move back.
  • Type /pattern and press Enter to search.
  • Press n for the next match.
  • Press q to quit.

Many commands also provide concise help:

$ ls --help

Tip

You do not need to memorize every option. Learn how to find reliable help and verify a command before applying it to important data.

3. Understand the Filesystem

Linux organizes data as a tree beginning at the root directory /.

/
├── etc/        system configuration
├── hpc/        Deceema storage hierarchy
│   └── home/
│       └── USER/   your home directory
├── tmp/        temporary system space
└── ...

Your home directory is your personal starting location. Linux represents it with both $HOME and ~.

$ printf '%s\n' "$HOME"
$ cd
$ pwd

Absolute and relative paths

An absolute path starts at / and identifies one location regardless of your current directory:

/hpc/home/username/training/linux/notes.txt

A relative path starts from your current directory:

training/linux/notes.txt

Useful path symbols:

Symbol Meaning
/ Filesystem root, or a separator between path components.
~ Your home directory.
. The current directory.
.. The parent of the current directory.

4. Create Your Safe Practice Workspace

Create a directory used only for this tutorial:

$ mkdir -p "$HOME/training/linux-beginner"
$ cd "$HOME/training/linux-beginner"
$ pwd

The final output should end with:

/training/linux-beginner

mkdir creates a directory. The -p option also creates missing parent directories and does not complain when the directory already exists.

Build a simple project structure:

$ mkdir data scripts logs results
$ ls

You should see four directory names: data, logs, results, and scripts.

Practice navigation

$ cd data
$ pwd
$ cd ..
$ cd results
$ cd "$HOME/training/linux-beginner"
$ pwd

Try it yourself

From the practice directory, enter scripts, return to its parent using .., then enter logs. Run pwd after every move.

5. List and Inspect Files

Create a small text file:

$ printf 'sample,value\nalpha,10\nbeta,20\ngamma,30\n' > data/measurements.csv

The > operator redirects output into a file. It replaces an existing file, so inspect the destination before using it with valuable data.

List the file:

$ ls -l data

A detailed listing includes permissions, owner, group, size, modification time, and name.

Read files in different ways

$ cat data/measurements.csv
$ head -n 2 data/measurements.csv
$ tail -n 2 data/measurements.csv
$ wc -l data/measurements.csv
$ file data/measurements.csv
Command Use
cat Print a small file.
head Show the beginning.
tail Show the end.
wc -l Count lines.
file Identify the file type.

For a large text file, use a pager:

$ less data/measurements.csv

Press q to exit.

Hidden files

Linux names beginning with . are hidden from a normal ls listing:

$ printf 'training=true\n' > .settings
$ ls
$ ls -la

ls -la includes hidden entries.

6. Create, Copy, and Move Files

Create an empty file and verify it:

$ touch notes.txt
$ ls -l notes.txt

Copy the dataset:

$ cp -- data/measurements.csv data/measurements-copy.csv
$ ls -l data

Rename the copy:

$ mv -- data/measurements-copy.csv data/measurements-backup.csv
$ ls -l data

Move the notes file:

$ mv -- notes.txt logs/notes.txt
$ ls -l logs

The -- marker tells commands that later values are operands, even if a filename begins with -.

Append instead of replace

>> appends output to the end of a file:

$ printf 'Tutorial started successfully\n' >> logs/notes.txt
$ printf 'Practice workspace created\n' >> logs/notes.txt
$ cat logs/notes.txt

Copy and move can overwrite

Commands may replace an existing destination without the kind of graphical warning you expect. Inspect both source and destination first, especially in a shared project directory.

7. Search for Text and Files

Search inside a file:

$ grep -n 'beta' data/measurements.csv
3:beta,20

-n includes the matching line number. Search without case sensitivity:

$ grep -in 'GAMMA' data/measurements.csv

Find files below the current directory:

$ find . -type f
$ find . -type f -name '*.csv'
  • . means start in the current directory.
  • -type f selects files.
  • -name '*.csv' selects names ending in .csv.

The quotes prevent the shell from expanding the pattern before find sees it.

Understand wildcards

The shell expands * before starting a command. Preview matches safely:

$ printf '%s\n' data/*.csv

Find your work

Search the practice directory for the word training, then find every file whose name ends in .txt.

8. Combine Commands

A pipeline sends the output of one command into another with |:

$ tail -n +2 data/measurements.csv | sort

This skips the header and sorts the remaining lines.

Count matching rows:

$ grep -c 'a' data/measurements.csv

Use && when the second command should run only if the first succeeds:

$ test -s data/measurements.csv && printf 'The dataset contains data\n'

Avoid building long, destructive command chains while learning. Run one observable step at a time when an operation changes data.

9. Understand Users, Groups, and Permissions

Linux access begins with three identities:

  • The file's owning user.
  • The file's owning group.
  • Other users.

Inspect a file and directory:

$ ls -l data/measurements.csv
$ ls -ld data
$ id

A mode such as -rw-r----- can be read as:

-  rw-  r--  ---
│   │    │    └── other users
│   │    └─────── owning group
│   └──────────── owning user
└──────────────── file type (- file, d directory)

Permission letters mean:

Permission File Directory
r Read contents. List names.
w Modify contents. Create, rename, or remove entries.
x Execute as a program. Enter or traverse the directory.

Create a small script:

$ printf '#!/bin/bash\nprintf "Hello from a Linux script\\n"\n' > scripts/hello.sh
$ chmod u+x scripts/hello.sh
$ ls -l scripts/hello.sh
$ ./scripts/hello.sh

chmod u+x adds execute permission for the owning user.

Never use chmod 777 as a quick fix

It grants read, write, and execute permissions to everyone. On shared infrastructure, that can expose or corrupt project data. Inspect ownership and ask Support when access is unclear.

10. Remove Practice Files Safely

Deletion from the command line may not have a trash folder or undo option. Practice only on the disposable backup created earlier.

First resolve and inspect the exact target:

$ realpath data/measurements-backup.csv
$ ls -l data/measurements-backup.csv

Then remove that one file and verify the result:

$ rm -i -- data/measurements-backup.csv
$ test ! -e data/measurements-backup.csv && printf 'Backup removed\n'

-i requests confirmation. Do not assume all deletion commands or aliases will do so.

Stop before recursive deletion

Never run recursive deletion against an unresolved variable, wildcard, home directory, project root, or path you have not listed and verified. For this tutorial, you do not need rm -r at all.

11. Measure Storage Use

Measure the practice directory:

$ du -sh "$HOME/training/linux-beginner"
$ du -h --max-depth=1 "$HOME/training/linux-beginner" | sort -h
$ df -h "$HOME"
  • du estimates space used by files under a path.
  • df reports capacity for the filesystem containing a path.

df does not necessarily show your personal or project allocation. Deceema's approximately 100 TB is shared capacity, not a personal entitlement. See Storage for planning, transfer, integrity, and cleanup guidance.

12. Inspect Processes

A process is a running program. List processes owned by your account:

$ ps -u "$USER" -o pid,etime,stat,cmd
Field Meaning
PID Process identifier.
ELAPSED How long it has existed.
STAT Process state flags.
CMD Command being run.

For scheduled work, query Slurm:

$ squeue --user="$USER"

Respect the login node

Login nodes are for navigation, editing, transfers, environment setup, job submission, and light inspection. Run computationally demanding or long-lived work through Slurm.

13. Load Software with Modules

Shared HPC systems use environment modules to make supported software available without changing the operating system.

Start clean, load the Deceema environment, and inspect it:

$ module purge
$ module load deceema
$ module list

Depending on the module system configuration, useful discovery commands may include:

$ module avail
$ module show deceema

RHEL uses DNF for operating-system packages, but regular HPC users generally do not administer the shared system. Do not attempt to bypass those controls. Use modules, Python virtual environments, R project libraries, approved containers, or request software through Support.

14. Archive a Directory

An archive packages related files into one file. From the practice directory:

$ tar -cf linux-beginner.tar data scripts logs results
$ tar -tf linux-beginner.tar
  • -c creates an archive.
  • -f names the archive file.
  • -t lists archive contents without extracting them.

Inspect its size:

$ ls -lh linux-beginner.tar

An archive is useful for organizing or transferring many related files, but it is not automatically an independent backup.

15. Final Project: Organize a Small Dataset

Complete this challenge inside $HOME/training/linux-beginner:

  1. Create data/raw and data/processed directories.
  2. Copy data/measurements.csv to data/raw/measurements.csv.
  3. Create data/processed/high-values.csv containing the header and rows whose numeric value is at least 20.
  4. Count the lines in both files.
  5. Record the commands and current date in logs/final-project.txt.
  6. Inspect the result, ownership, permissions, and storage size.
  7. Create final-project.tar containing data, logs, and scripts.
  8. List the archive without extracting it.

One possible filtering command is:

$ awk -F, 'NR == 1 || $2 >= 20' data/raw/measurements.csv \
    > data/processed/high-values.csv

Expected processed data:

sample,value
beta,20
gamma,30

You have completed the Linux foundation

You can now navigate, organize, inspect, search, protect, measure, and package data—the core Linux skills needed before Bash and Slurm automation.

Command Cheat Sheet

Goal Command
Show current location pwd
Return home cd
List details ls -lh PATH
Create directories mkdir -p PATH
Read a small file cat FILE
Page through a file less FILE
Copy a file cp -- SOURCE DESTINATION
Move or rename mv -- SOURCE DESTINATION
Search file content grep -n PATTERN FILE
Find files find PATH -type f -name PATTERN
Inspect permissions ls -ld PATH
Measure used space du -sh PATH
Show filesystem capacity df -h PATH
List your Slurm jobs squeue --user="$USER"
Open a manual man COMMAND

Common Beginner Mistakes

Mistake Better habit
Typing the example $ prompt Type only the command following it.
Losing track of the current directory Run pwd before path-sensitive work.
Confusing an absolute and relative path Use realpath PATH to verify the target.
Assuming a command will ask before overwriting Inspect source and destination first.
Using a wildcard without checking matches Preview it with printf '%s\n' PATTERN.
Printing a huge file with cat Use less, head, or tail.
Applying chmod 777 to fix access Inspect ownership and request the minimum access needed.
Installing system packages personally Use modules or a project environment.
Running heavy work after login Submit substantial computation through Slurm.

Completion Checklist

  • I understand the terminal, shell, command, option, argument, and path.
  • I can navigate using absolute and relative paths.
  • I can safely create, inspect, copy, move, search, and remove one file.
  • I understand user, group, other, and the rwx permissions.
  • I know the difference between du and df.
  • I can inspect my processes and Slurm jobs.
  • I use modules or project environments instead of changing RHEL itself.
  • I completed and verified the final project.

Continue Learning

Learn Bash scripting Review storage practices

Official RHEL References