RED HAT ENTERPRISE LINUX

Getting Started with the Shell

Logging In and Running Simple Commands

CIS126RH | RHEL System Administration 1
Mesa Community College

Learning Objectives

Log in to a Linux system

Access local consoles, graphical environments, and remote systems via SSH

2
Understand the shell environment

Know what a shell is, identify Bash, and interpret the command prompt

3
Run basic commands

Execute commands for navigation, file listing, and system information

4
Use command syntax and shortcuts

Understand options, arguments, and keyboard shortcuts for efficiency

What is a Shell?

A shell is a command-line interpreter that provides an interface between the user and the operating system kernel. It reads commands you type, interprets them, and executes them.

Shell (Bash)
Kernel
Hardware

Bash

Bourne Again Shell - the default shell in RHEL and most Linux distributions

sh, zsh, fish

Other shells with different features - Bash is most common for administration

Ways to Access the Shell

Terminal Emulator

Graphical application like GNOME Terminal that provides shell access

SSH (Remote)

Secure Shell protocol for remote command-line access over the network

# Connect to a remote server via SSH
[student@workstation ~]$ ssh student@server.example.com
student@server.example.com's password:
[student@server ~]$

# SSH with specific options
[student@workstation ~]$ ssh -l student 192.168.1.100
[student@workstation ~]$ ssh student@192.168.1.100 -p 22
Most Common: As a system administrator, you'll primarily access servers remotely via SSH. Physical console access is for emergencies or initial setup.

tty1
Ctrl+Alt+F1
GUI or Text
tty2
Ctrl+Alt+F2
Text
tty3
Ctrl+Alt+F3
Text
tty4
Ctrl+Alt+F4
Text
tty5
Ctrl+Alt+F5
Text
tty6
Ctrl+Alt+F6
Text
# See which terminal you're on
[student@server ~]$ tty
/dev/tty2

# See who is logged into which terminals
[student@server ~]$ w
USER     TTY      FROM             LOGIN@   WHAT
student  tty2     -                09:15    -bash
student  pts/0    192.168.1.50     09:20    w

The Process

Red Hat Enterprise Linux 9 - Console Login
Red Hat Enterprise Linux 9.0 (Plow)
Kernel 5.14.0-70.el9.x86_64 on an x86_64

server login: student
Password: ••••••••

Last login: Mon Jan 15 09:15:22 2024 from 192.168.1.50
[student@server ~]$

Your account name (case-sensitive)

Password: Characters not displayed as you type

Last login: Shows when and from where

Prompt: Ready for commands

⚠ Note: Linux usernames and passwords are case-sensitive. "Student" and "student" are different users!

Understanding the Prompt

student
@
server
~
$

student — Current username (who you're logged in as)

server — Hostname (which system you're on)

~ — Current directory (~ means home directory)

$ — Prompt symbol ($ for regular user, # for root)

# Regular user prompt
[student@server ~]$

# Root user prompt - note the # symbol
[root@server ~]#

# In a different directory
[student@server Documents]$

# Full path shown
[student@server /var/log]$

Command Syntax

comman