0% found this document useful (0 votes)
231 views4 pages

Rhel 10 Cheat Sheet

The document provides a comprehensive cheat sheet for Red Hat Enterprise Linux (RHEL) 10, detailing essential Linux commands, package management with DNF, and the use of the RHEL web console for system administration. It also covers creating OS images using Red Hat Insights Image Builder and managing containers with Podman, including instructions for using WSL. Overall, it serves as a quick reference guide for RHEL users to perform common tasks and manage their systems effectively.

Uploaded by

sudha1010
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
231 views4 pages

Rhel 10 Cheat Sheet

The document provides a comprehensive cheat sheet for Red Hat Enterprise Linux (RHEL) 10, detailing essential Linux commands, package management with DNF, and the use of the RHEL web console for system administration. It also covers creating OS images using Red Hat Insights Image Builder and managing containers with Podman, including instructions for using WSL. Overall, it serves as a quick reference guide for RHEL users to perform common tasks and manage their systems effectively.

Uploaded by

sudha1010
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

developers.redhat.

com redhat-developer @rhdevelopers

Cheat sheet

Red Hat Enterprise Linux 10


Red Hat Enterprise Linux (RHEL) is the world's leading enterprise Linux platform. From the public cloud to
the edge, it evolves to bring flexibility and reliability to new frontiers.

Essential Linux commands


Some commands everyone needs to know. These are some of the most common commands any RHEL
user is likely to use every day.
Task Command Example
Change directory cd cd ~/Documents
List files and directories ls ls
Get current working directory pwd pwd
Get URL curl curl http://example.com
View file contents cat cat ~/Documents/Readme.md
Find a file by part of the file name find find ~ -name "*.txt"
Unzip a file unzip unzip example.zip
Untar a file tar tar --extract --file example.tar.gz
Rename or move a file mv mv notes.txt Readme.md
Log in as tux, to a remote system ssh ssh tux@10.0.1.172
Elevate permissions sudo sudo mv my.config /etc/

AI command-line assistant
If you don't know what command you need or how to use it, ask the AI command-line assistant for help:

$ c "What command finds all files containing a specific string?"


[bash] grep -rnw "$HOME" -e "example"

$ c "How do I open a port for SSH"


[bash] firewall-cmd --permanent –add-service=ssh
firewall-cmd --reload
developers.redhat.com redhat-developer @rhdevelopers

Package management with DNF


Task Command

Update installed packages to latest versions sudo dnf update

Update, but remove obsolete packages sudo dnf upgrade

Install a package sudo dnf install <example>

Remove an installed package sudo dnf remove <example>

Search repository for a package sudo dnf search <example>

Get information about a package sudo dnf info <example>

List package groups sudo dnf grouplist -v

Install package group sudo dnf groupinstall example-group

List installed packages sudo dnf list installed

Web console
The RHEL web console is a web-based graphical interface, which is based on the upstream Cockpit project.
Without detailed knowledge of the RHEL command-line administrative tools, you can perform system
administration tasks, such as inspecting and controlling systemd services, managing storage, configuring
networks, analyzing network issues, and inspecting logs.

In many cases, the RHEL web console is installed by default. To install, configure, and launch Cockpit:
$ sudo dnf install cockpit
$ sudo systemctl enable --now cockpit.socket
$ sudo firewall-cmd --add-service=cockpit --permanent
$ sudo firewall-cmd --reload

In a web browser, connect to https://hostname:9090 to access the web console.


developers.redhat.com redhat-developer @rhdevelopers

Red Hat Insights Image Builder

Creating a "golden image" of an operating system (OS) is a popular and recommended practice for
deploying new systems to any environment. This includes physical and virtual images for your data center,
the public clouds, and edge deployments. They ensure rapid deployments that are consistent, repeatable,
and conform to your unique Standard Operating Environment requirements. You can build an OS image
using Insights Image Builder with console.redhat.com.

First, click Create blueprint to define what you want included in your OS image. You can build an image
for public clouds, your private cloud, bare metal, and for a WSL install. You can customize your image so it's
registered after install, and to include any number of packages and services by default.

Follow the prompts to create your image, or skip to the end to accept the default build.
developers.redhat.com redhat-developer @rhdevelopers

Containers and image mode


Define your image in a Containerfile:

FROM registry.redhat.io/rhel10/rhel-bootc:latest
RUN echo "echo hello bootc" > /usr/bin/hello
RUN chmod +x /usr/bin/hello

Build the image using Podman:

$ podman build --tag quay.io/tux/my_rhel10:bootc .

Optionally, create a Podman machine:

$ podman machine init


$ podman machine set --rootful
$ podman machine start

Push the image to your repository:

$ podman login quay.io


$ podman push quay.io/tux/my_rhel10:bootc

Run the bootc container with Podman:

$ podman-bootc run --filesystem=xfs quay.io/tux/my_rhel10:bootc

Windows subsystem for Linux (WSL)


Using Insights image builder, create a customized WSL - Windows Subsystem for Linux (.tar.gz) image.

Download the .tar.gz image to your Windows machine.

Import the image. For example, in PowerShell:

PS> wsl --import rhel10wsl D:\WLS\rhel10wsl \Download\my_image.tar.gz

Launch the image:

PS> wsl -d rhel10wsl

You might also like