Posts for: #Linux

System Logging

Definition

Syslogs contain subsets of information on faults, events, audit & session data, all related the monitored objects. Not all logs depict errors. Syslog can include audit and event logs.

Syslog Facilities

Any program or process capable of generating syslogs.

Syslog Severities

aka syslog severity levels or syslog priorities. The describe different levels of importance. Example of syslog severities: emergency, alert, critical, informational, warnings.

How Linux implements logging

rsyslogd

Verify the version of rsyslogd deployed on a RHEL machine:

[Read]

The Linux Kernel

Finding the kernel packages

The Linux kernel is not a monolithic file but rather a set of RPM packages.

Find out the installed kernel packages:

user1@localhost:~$ rpm -qa *kernel*
kernel-modules-extra-matched-6.12.0-124.8.1.el10_1.x86_64
kernel-tools-libs-6.12.0-124.8.1.el10_1.x86_64
kernel-modules-core-6.12.0-124.8.1.el10_1.x86_64
kernel-core-6.12.0-124.8.1.el10_1.x86_64
kernel-modules-6.12.0-124.8.1.el10_1.x86_64
kernel-modules-extra-6.12.0-124.8.1.el10_1.x86_64
kernel-tools-6.12.0-124.8.1.el10_1.x86_64
kernel-6.12.0-124.8.1.el10_1.x86_64
user1@localhost:~$ 

Find out the kernel version and release:

user1@localhost:~$ uname --help
Usage: uname [OPTION]...
Print certain system information.  With no OPTION, same as -s.

  -a, --all                print all information, in the following order,
                             except omit -p and -i if unknown:
  -s, --kernel-name        print the kernel name
  -n, --nodename           print the network node hostname
  -r, --kernel-release     print the kernel release
  -v, --kernel-version     print the kernel version
  -m, --machine            print the machine hardware name
  -p, --processor          print the processor type (non-portable)
  -i, --hardware-platform  print the hardware platform (non-portable)
  -o, --operating-system   print the operating system
      --help        display this help and exit
      --version     output version information and exit

GNU coreutils online help: <https://www.gnu.org/software/coreutils/>
Full documentation <https://www.gnu.org/software/coreutils/uname>
or available locally via: info '(coreutils) uname invocation'
user1@localhost:~$ 
user1@localhost:~$ uname -v
#1 SMP PREEMPT_DYNAMIC Fri Oct 17 13:03:58 EDT 2025
user1@localhost:~$ uname -r
6.12.0-124.8.1.el10_1.x86_64
user1@localhost:~$ 

Kernel-related files

in the /boot directory

With the exception of the efi and grub2 directories, which deal with the bootloader for UEFI and BIOS systems respectively, the rest of the files and subdirectories under the /boot/ directory are related to the kernel.

[Read]

Linux GRUB2

Grub2 is a popular bootloader for BIOS and UEFI systems. It typically displays boot entries in a black background during system start. Each of these boot entries seem to be a reference to a set of configuration instructions that are defined in files. Such files are located under /boot/loader/entries/ according the the man page of grubby.

user1@rhel10-vm2:~$ ls /boot/loader/entries/
ls: cannot open directory '/boot/loader/entries/': Permission denied
user1@rhel10-vm2:~$ 
user1@rhel10-vm2:~$ sudo ls /boot/loader/entries/
995c0067e7c140f28c8539b917f55418-0-rescue.conf
995c0067e7c140f28c8539b917f55418-6.12.0-55.43.1.el10_0.x86_64.conf
user1@rhel10-vm2:~$ 

When my lab VM is booting, grub2 shows only two boot entries. And I found only two files under /boot/loader/entries/.

[Read]

Application Management with Flatpak

Installing and Removing Flatpak

Read this technote

Flatpak and Remotes

A Flatpak remote is a local representation of an online Flatpak repository. It can be a statically defined ‘.flatpakrepo’ file, manually placed under ‘/etc/flatpak/repos.d/’, or a dynamically defined section of the active configuration file, which is the ‘/var/lib/flatpak/repo/config’ file.

The addition of a description of a Flatpak remote in the active configuration file is performed by the Flatpak tool, when the command flatpak remote-add is executed.

[Read]

Linux Units

Linux units

Units are configuration files that describe the resources that are managed by systemd. They are stored in four file system paths. If I do a manual search I can approximately tell where they are:

Wassim@linux:~$ find / -mindepth 1 -name systemd 2>/dev/null
/home/Wassim/Documents/ddupdate/systemd
/home/Wassim/.config/systemd
/run/systemd
/run/udev/tags/systemd
/run/user/1000/systemd
/etc/xdg/systemd
/etc/systemd
/var/lib/systemd
/var/lib/flatpak/runtime/org.gnome.Platform/x86_64/49/e51263e53d04900556e2f97ac2b27201f632f604d68d67f50323f9a99389fdb0/files/lib/systemd
/var/lib/flatpak/runtime/org.gnome.Platform/x86_64/49/e51263e53d04900556e2f97ac2b27201f632f604d68d67f50323f9a99389fdb0/files/share/licenses/gnome/systemd
/var/lib/flatpak/runtime/org.gnome.Platform/x86_64/50/a8da766dd0273a67539d2b98358ed6809d8e729280baf63428108837135229d3/files/lib/systemd

<---- output omitted ---->

/var/lib/snapd/snap/gnome-3-38-2004/143/usr/lib/systemd
/usr/lib/systemd
/usr/lib/systemd/systemd
/usr/lib64/systemd
/usr/lib64/python3.12/site-packages/systemd
/usr/share/licenses/systemd
/usr/share/doc/systemd
/usr/share/systemd
/usr/share/cockpit/systemd
Wassim@linux:~$ 

/run/systemd seem to store runtime unit files, because /run/ typically contains runtime data, so it can not be a permanent location of systemd unit files. There is also /etc/systemd and /usr/lib/systemd/system/. The latter appears to store system units:

[Read]

Package Management with dnf

listing repos with DNF

List the enabled repos: either with dnf repolist or dnf repolist --enabled. I can add the verbose option -v.

user1@localhost:~$ dnf repolist -v
Loaded plugins: builddep, changelog, config-manager, copr, debuginfo-install, download, generate_completion_cache, groups-manager, kpatch, needs-restarting, notify-packagekit, playground, product-id, repoclosure, repodiff, repograph, repomanage, reposync, subscription-manager, system-upgrade, uploadprofile
Not root, Subscription Management repositories not updated
DNF version: 4.20.0
cachedir: /var/tmp/dnf-user1-w76vxc5s
OS software                                                   2.7 MB/s | 2.7 kB     00:00    
Application software                                          2.7 MB/s | 2.8 kB     00:00    
Repo-id            : AppStream
Repo-name          : Application software
Repo-revision      : 1761027148
Repo-updated       : Tue 21 Oct 2025 08:12:28 AM CEST
Repo-pkgs          : 4,514
Repo-available-pkgs: 4,514
Repo-size          : 6.5 G
Repo-baseurl       : file:///mnt/AppStream
Repo-expire        : 172,800 second(s) (last: Sat 04 Jul 2026 10:29:26 PM CEST)
Repo-filename      : /etc/yum.repos.d/local.repo

Repo-id            : baseOS
Repo-name          : OS software
Repo-revision      : 1761027164
Repo-updated       : Tue 21 Oct 2025 08:12:45 AM CEST
Repo-pkgs          : 946
Repo-available-pkgs: 946
Repo-size          : 1.3 G
Repo-baseurl       : file:///mnt/BaseOS
Repo-expire        : 172,800 second(s) (last: Sat 04 Jul 2026 10:29:26 PM CEST)
Repo-filename      : /etc/yum.repos.d/local.repo
Total packages: 5,460
user1@localhost:~$ 
user1@localhost:~$ dnf repolist --enabled -v
Loaded plugins: builddep, changelog, config-manager, copr, debuginfo-install, download, generate_completion_cache, groups-manager, kpatch, needs-restarting, notify-packagekit, playground, product-id, repoclosure, repodiff, repograph, repomanage, reposync, subscription-manager, system-upgrade, uploadprofile
Not root, Subscription Management repositories not updated
DNF version: 4.20.0
cachedir: /var/tmp/dnf-user1-w76vxc5s
Last metadata expiration check: 0:05:39 ago on Sat 11 Jul 2026 05:38:51 PM CEST.
Repo-id            : AppStream
Repo-name          : Application software
Repo-revision      : 1761027148
Repo-updated       : Tue 21 Oct 2025 08:12:28 AM CEST
Repo-pkgs          : 4,514
Repo-available-pkgs: 4,514
Repo-size          : 6.5 G
Repo-baseurl       : file:///mnt/AppStream
Repo-expire        : 172,800 second(s) (last: Sat 11 Jul 2026 05:38:51 PM CEST)
Repo-filename      : /etc/yum.repos.d/local.repo

Repo-id            : baseOS
Repo-name          : OS software
Repo-revision      : 1761027164
Repo-updated       : Tue 21 Oct 2025 08:12:45 AM CEST
Repo-pkgs          : 946
Repo-available-pkgs: 946
Repo-size          : 1.3 G
Repo-baseurl       : file:///mnt/BaseOS
Repo-expire        : 172,800 second(s) (last: Sat 11 Jul 2026 05:38:51 PM CEST)
Repo-filename      : /etc/yum.repos.d/local.repo
Total packages: 5,460
user1@localhost:~$ 

#LessonLearned There is no difference in output between dnf repolist -v and dnf repolist --enabled -v.

[Read]

Miscellaneous Operations in Linux

users

The useradd command with the -b option creates a base directory for the user account. The home directory is always the concatenation of the base directory and the user account name, according to Linux man pages.

user01@rhel10-vm4:~$ sudo useradd user02 -b /myBaseDir
Creating mailbox file: File exists
user01@rhel10-vm4:~$
user01@rhel10-vm4:~$ sudo su - user02
Last login: Fri Oct  2 01:27:39 EDT 2026 on pts/3
user02@rhel10-vm4:~$ pwd
/myBaseDir/user02
user02@rhel10-vm4:~$

I delete the user account, recreate it without the -b option and check its home directory again:

[Read]

Using vim

my environment

  • I installed vim on Windows
  • added the following directives at the end of the _vimrc file:
:colorscheme ron

:set guioptions +=d
:set guioptions -=m
:set guioptions -=T
:set guioptions -=r

They respectively:

  • set the colorscheme to ron,
  • enable dark mode,
  • remove the menu bar,
  • remove the tools bar,
  • remove the right scrollbar.

references

  • reddit.com/r/vim/comments/fq7lk5/windows_10_gvim_dark_menu_bar/
  • stackoverflow.com/questions/13525518/how-to-hide-the-menu-tool-bar-of-gvim
  • reddit.com/r/vim/comments/fq7lk5/windows_10_gvim_dark_menu_bar/
[Read]

Linux Package Management with RPM

RPM Package States

An RPM package can be in either of the following states:

  • installed
  • available, i.e. installable:
    • as an individual physical RPM file, such as downloaded from a public RPM repository,
    • as a physical RPM file, part of a DNF repository.

Install an RPM package

Wassim@linux:~/Downloads$ rpm -i zoom_x86_64.rpm 
warning: zoom_x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 9706ac24: NOKEY
error: can't create transaction lock on /usr/lib/sysimage/rpm/.rpm.lock (Permission denied)
Wassim@linux:~/Downloads$ 
Wassim@linux:~/Downloads$ sudo rpm zoom_x86_64.rpm
[sudo] password for Wassim: 
RPM version 4.19.1.1
Copyright (C) 1998-2002 - Red Hat, Inc.
This program may be freely redistributed under the terms of the GNU GPL

Usage: rpm [-afgpqlsiv?] [-a|--all] [-f|--file] [--path] [-g|--group] [-p|--package]
        [--pkgid] [--hdrid] [-q|--query] [--triggeredby] [--whatconflicts]
        [--whatrequires] [--whatobsoletes] [--whatprovides] [--whatrecommends]
        [--whatsuggests] [--whatsupplements] [--whatenhances] [--nomanifest]
        [-c|--configfiles] [-d|--docfiles] [-L|--licensefiles] [-A|--artifactfiles]
        [--noghost] [--noconfig] [--noartifact] [--dump] [-l|--list]
        [--queryformat=QUERYFORMAT] [-s|--state] [--nofiledigest] [--nofiles] [--nodeps]
        [--noscript] [--allfiles] [--allmatches] [--badreloc] [-e|--erase=<package>+]
        [--excludedocs] [--excludepath=<path>] [--force] [-F|--freshen=<packagefile>+]
        [-h|--hash] [--ignorearch] [--ignoreos] [--ignoresize] [--noverify]
        [-i|--install] [--justdb] [--nodb] [--nodeps] [--nofiledigest] [--nocontexts]
        [--nocaps] [--noorder] [--noscripts] [--notriggers] [--oldpackage] [--percent]
        [--prefix=<dir>] [--relocate=<old>=<new>] [--replacefiles] [--replacepkgs]
        [--test] [-U|--upgrade=<packagefile>+] [--reinstall=<packagefile>+]
        [--restore=<packagefile>+] [-D|--define='MACRO EXPR'] [--undefine=MACRO]
        [-E|--eval='EXPR'] [--target=CPU-VENDOR-OS] [--macros=<FILE:...>] [--load=<FILE>]
        [--noplugins] [--nodigest] [--nosignature] [--rcfile=<FILE:...>] [-r|--root=ROOT]
        [--dbpath=DIRECTORY] [--querytags] [--showrc] [--quiet] [-v|--verbose]
        [--version] [-?|--help] [--usage] [--scripts] [--conflicts] [--obsoletes]
        [--provides] [--requires] [--recommends] [--suggests] [--supplements]
        [--enhances] [--info] [--changelog] [--changes] [--xml] [--triggers]
        [--filetriggers] [--last] [--dupes] [--filesbypkg] [--fileclass] [--filecolor]
        [--fileprovide] [--filerequire] [--filecaps]
Wassim@linux:~/Downloads$ 
Wassim@linux:~/Downloads$ 
Wassim@linux:~/Downloads$ sudo rpm -iv zoom_x86_64.rpm 
warning: zoom_x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 9706ac24: NOKEY
Verifying packages...
Preparing packages...
zoom-7.1.5.4332-1.x86_64
run post install script, action is 1...
Wassim@linux:~/Downloads$ 
Wassim@linux:~/Downloads$ rpm -qa zoom
zoom-7.1.5.4332-1.x86_64
Wassim@linux:~/Downloads$ 

Verify the integrity of an available RPM package

To verify the integrity, i.e. non corruption, of a RPM package: rpm -K. The command runs on the physical file of the RPM package. The command instructs the system to generate hash values based on the header and payload of the RPM physical file and compare them with the hash values stored in the RPM physical file itself.

[Read]

Linux Learning Map

# Objective Task Latest Skill Colour Passes
1.1 1 — Essential tools Access a shell prompt and issue commands with correct syntax
1.2 1 — Essential tools Use input-output redirection (>, >>, |, 2>, etc.)
1.3 1 — Essential tools Use grep and regular expressions to analyse text
1.4 1 — Essential tools Access remote systems using SSH
1.5 1 — Essential tools Log in and switch users in multiuser targets
1.6 1 — Essential tools Archive, compress, unpack and uncompress files using tar, star, gzip, bzip2
1.7 1 — Essential tools Create and edit text files
1.8 1 — Essential tools Create, delete, copy and move files and directories
1.9 1 — Essential tools Create hard and soft links
1.10 1 — Essential tools List, set and change standard ugo/rwx permissions
1.11 1 — Essential tools Locate, read and use system documentation (man, info, files in /usr/share/doc)
2.1 2 — Manage software Configure access to RPM repositories
2.2 2 — Manage software Install and remove RPM packages
2.3 2 — Manage software Configure access to Flatpak repositories
2.4 2 — Manage software Install and remove Flatpak packages
3.1 3 — Shell scripts Conditionally execute code (if, test, [], etc.)
3.2 3 — Shell scripts Use looping constructs (for, etc.) to process file and command-line input
3.3 3 — Shell scripts Process script inputs ($1, $2, etc.)
3.4 3 — Shell scripts Process output of shell commands within a script
4.1 4 — Operate running systems Boot, reboot and shut down a system normally
4.2 4 — Operate running systems Boot systems into different targets manually
4.3 4 — Operate running systems Interrupt the boot process in order to gain access to a system
4.4 4 — Operate running systems Identify CPU/memory intensive processes and kill processes
4.5 4 — Operate running systems Adjust process scheduling
4.6 4 — Operate running systems Manage tuning profiles
4.7 4 — Operate running systems Locate and interpret system log files and journals
4.8 4 — Operate running systems Preserve system journals
4.9 4 — Operate running systems Start, stop and check the status of network services
4.10 4 — Operate running systems Securely transfer files between systems
5.1 5 — Local storage List, create and delete partitions on MBR and GPT disks
5.2 5 — Local storage Create and remove physical volumes
5.3 5 — Local storage Assign physical volumes to volume groups
5.4 5 — Local storage Create and delete logical volumes
5.5 5 — Local storage Configure systems to mount file systems at boot by UUID or label
5.6 5 — Local storage Add new partitions, logical volumes and swap to a system non-destructively
6.1 6 — File systems Create, mount, unmount and use vfat, ext4 and xfs file systems
6.2 6 — File systems Mount and unmount network file systems using NFS
6.3 6 — File systems Configure autofs
6.4 6 — File systems Extend existing logical volumes
6.5 6 — File systems Create and configure set-GID directories for collaboration
6.6 6 — File systems Diagnose and correct file permission problems
7.1 7 — Deploy and maintain Schedule tasks using at and cron
7.2 7 — Deploy and maintain Start and stop services; configure services to start automatically at boot
7.3 7 — Deploy and maintain Configure systems to boot into a specific target automatically
7.4 7 — Deploy and maintain Configure time service clients
7.5 7 — Deploy and maintain Install and update packages from CDN, a remote repository, or the local file system
7.6 7 — Deploy and maintain Modify the system bootloader
8.1 8 — Basic networking Configure IPv4 and IPv6 addresses
8.2 8 — Basic networking Configure hostname resolution
8.3 8 — Basic networking Configure network services to start automatically at boot
8.4 8 — Basic networking Restrict network access using firewall-cmd / firewalld
9.1 9 — Users and groups Create, delete and modify local user accounts
9.2 9 — Users and groups Change passwords and adjust password aging for local user accounts
9.3 9 — Users and groups Create, delete and modify local groups and group memberships
9.4 9 — Users and groups Configure superuser access
10.1 10 — Manage security Configure firewall settings using firewall-cmd / firewalld
10.2 10 — Manage security Manage default file permissions
10.3 10 — Manage security Configure key-based authentication for SSH
10.4 10 — Manage security Set enforcing and permissive modes for SELinux
10.5 10 — Manage security List and identify SELinux file and process context
10.6 10 — Manage security Restore default file contexts
10.7 10 — Manage security Manage SELinux port labels
10.8 10 — Manage security Use boolean settings to modify system SELinux settings
10.9 10 — Manage security Diagnose and address routine SELinux policy violations

Exam Objectives

  • Understand and use essential tools
    • Access a shell prompt and issue commands with correct syntax
    • Use input-output redirection (>, », |, 2>, etc.)
    • Use grep and regular expressions to analyze text
    • Access remote systems using SSH
    • Log in and switch users in multi-user targets
    • Archive, compress, unpack, and uncompress files using tar, gzip, and bzip2
    • Create and edit text files
    • Create, delete, copy, and move files and directories
    • Create hard and soft links
    • List, set, and change standard ugo/rwx permissions
    • Locate, read, and use system documentation including man, info, and files in /usr/share/doc
exam item task skill color number of passes
understand and use essential tools access a shell prompt and issue commands with correct syntax

Manage software

- Configure access to RPM repositories
- Install and remove RPM software packages
- Configure access to Flatpak repositories
- Install and remove Flatpak software packages

Create simple shell scripts

- Conditionally execute code (use of: if, test, [], etc.)
- Use Looping constructs (for, etc.) to process file, command line input
- Process script inputs ($1, $2, etc.)
- Processing output of shell commands within a script

Operate running systems

- Boot, reboot, and shut down a system normally
- Boot systems into different targets manually
- Interrupt the boot process in order to gain access to a system
- Identify CPU/memory intensive processes and kill processes
- Adjust  process scheduling
- Manage tuning profiles
- Locate and interpret system log files and journals
- Preserve system journals
- Start, stop, and check the status of network services
- Securely transfer files between systems

Configure local storage

  • List, create, and delete partitions on GPT disks

[Read]