Introduction

Linux distributions differ from each other in many ways, but one of the most significant differences lies in package management and the update model.

Red Hat-based distributions (such as RHEL, CentOS, and Fedora) primarily use RPM packages and Yum/DNF package management. They are often aimed at enterprise use, emphasizing stability, long-term support (LTS), and commercial support. Red Hat distributions are updated regularly, but the latest features arrive more slowly because stability is prioritized.

Debian-based distributions (such as Debian itself and Ubuntu) use DEB packages and APT package management. Debian is known for its stability and wide software support. Updates can be slower in the “Stable” version, but users can also use “Testing” or “Unstable” versions to access newer packages.

In summary, Red Hat derivatives focus on stability and support suitable for enterprise use, while Debian offers a wide range of software and flexibility, especially in open-source environments.

 

Navigation and File System

In Linux, a large part of the work is done in the terminal. First, you learn how to navigate the file system.

Change directory:

cd <directory>

Move one level up:

cd ..

List files:

ls

 

Creating and Deleting Files and Folders

Create a file using a text editor:

nano <file> tai vim <file>

Create a file using a command:

echo "text" > <file>

Create a folder:

mkdir <folder_name>

Delete a file:

rm <file>

Delete a folder and its contents:

rm -R <folder>

 

Let’s do a small exercise where we create our own folder and write a file into it.

Create a new folder named “test”:

mkdir test

Move into it:

cd test

Check that the file has been created:

ls

 Create a new file named “story.txt” and write some text into it:

echo "Once upon a time, there was a little Linux fox who learned to use the terminal." > story.txt

Print the contents of the file on the screen:

cat story.txt

Later, you can open and edit the file with a text editor, for example:

nano story.txt

If you want to delete the file:

rm story.txt

If you want to delete the entire folder and its contents:

rm -r testi

 

Installing Packages

Debian/Ubuntu

Install:

sudo apt-get install <package>

Remove:

sudo apt-get purge <package>

 

CentOS/Fedora (<22):

Install:

sudo yum install <package>

Remove:

sudo yum remove <package>

 

Other Useful Commands

Clear the terminal:

clear

View a file’s contents:

cat <file>

Run a command as an administrator:

sudo <command>

Check the location of a program:

which <program> 
 

 

Updating the Source List (sources.list)

The source list is the file:

/etc/apt/sources.list

APT package manager uses this list to download and update software.

If the source list is broken or outdated:

  1. Go to an online source list generator for Ubuntu or Debian (e.g., Repogen

  2. Select your system details
  3. Copy the generated list and replace the contents of /etc/apt/sources.list

 

 

Updates

Red Hat-based distributions

Updates are usually done from the command line as follows:

Fedora / newer RHEL:

sudo dnf update 

Older RHEL / CentOS:

sudo yum update

 

Debian-based distributions

On Debian and Ubuntu systems, use APT:

Update package repository information:

sudo apt update

Upgrade all installed packages to the latest version:

sudo apt upgrade

Debian also has dist-upgrade or full-upgrade commands, which can handle dependency changes when new package versions are installed.

 

For Security

It’s a good idea to follow these instructions: SSH key usage and disabling root login.

 

 

Connecting to a Remote Desktop

AlmaLinux

Debian

Oracle LInux

Rocky Linux

Ubuntu

 

Editing the Welcome Message in the Terminal

You can edit the message that appears after SSH login as follows:

sudo nano /etc/motd

 

Write your desired message — in this case, add a cool “Tietokettu” pixel art.

Save (Ctrl+O, Enter, Ctrl+X)

 

 

Log in again and check the result.

This is how you set a custom welcome message.

 

Summary

You have now learned the basics of Linux:

  • Navigating directories and managing files

  • Installing and removing programs

  • Fixing package list issues

  • Updating the system

  • Editing the login message

With these fundamentals, you can handle the most important Linux tools and are ready to move on to the next topics — such as user management, process monitoring, and network configuration.

Was this answer helpful? 16 Users Found This Useful (32 Votes)