Guide of Scifir

How to learn Linux

2023-09-05 Ismael Correa C. start, informatics

Welcome! In this guide you’ll learn how to learn all about Linux, from the start to the more deep topics, in order that you can become an expert on Linux if you want.

History of Linux

Linux is a kernel for operating systems, created by Linus Torvalds the 17 of september of 1991. Based on the Linux kernel, there are several Linux distributions, each having different preinstalled packages. The Linux kernel is developed by the Linux Foundation, founded by Linus Torvalds.

The most important Linux distribution is usually considered Debian, started in 1993. The other very important is Fedora, started in 2003. The most used is Ubuntu, which is strongly based on Debian, and has started in 2004.

GNU/Linux is another name given to Linux given the fact that the software of GNU for operating systems is essential in Linux. Then, the names Linux and GNU/Linux can be used interchangeably.

UNIX is in a wide amount of senses the predecessor of Linux, it has been created by Dennies Ritchie and Ken Thompson in 1969 at Bell Labs.

The symbol of Linux is Tux, a penguin.

The open source community

All the software of Linux, and, also, the distribution and the kernel, are open source, which means that their code is available through internet, and can be changed freely by programmers to make the software meet their needs.

The open source community is wide, it includes people from all nationalities and cultures. You can just browse through the web, search websites of open source software and, if you know programming, participate there. There are also IRC networks to chat and talk about informatics and open source in general.

The central websites to know currently about open source software are github, gitlab and sourceforge, they store the open source projects, which can be downloaded, and you can participate in if you want.

Basic concepts of operating systems

Operating systems are always, strictly speaking, a program that controls the processes the computer executes and, also, which hardware devices can those program access, and under which rules and/or permissions (if there are on the operating system, which usually is the case).

Common file types

Common file types used inside all operating systems, like Linux distributions, Windows and MacOS, are presented here. All should be completely known by Linux users, without exception.

Image file types are the following:

Video file types are the following:

Audio file types are the following:

Document file types are the following:

Windows has the following file formats that are used mainly in that operating system, more than in Linux distributions. They are the following:

The Linux kernel and Linux distros

The Linux distributions more used are the following:

Installing Linux

BIOS

You need to know how to use the BIOS in order to install and configure a Linux distribution, then it’s explained here.

A firmware is a software preinstalled inside a hardware that allows to control it. The BIOS, acronym of Basic Input/Output System, is a firmware, usually of the motherboard (it can strictly be part of other hardware components for some electronic chips), that allows to control the initialization of the hardware during the booting process (the booting is the start of the computer) and to control runtime services. In 2023, all desktop computers have their BIOS inside the motherboard, or UEFI, is successor. IBM created the BIOS.

To start the BIOS you have to type F11, DEL, or another key, just after clicking on the power button. On the first screen that appears there’s a message that says which key to type to access the BIOS.

Apart from the BIOS, recently it has been invented UEFI, acronym of Unified Extensible Firmware Interface. UEFI has been created by the UEFI Forum, a consortium, contrary to the BIOS which is proprietary software. The advantages of UEFI over BIOS is that it supports hardware with more capability, among other features.

For Linux, the Linux community has developed coreboot, previously called LinuxBIOS, a replacement for the BIOS and UEFI that is lightweight and performs the minimum number of tasks necessary to load and run an operating system of 32-bit or 64-bit. One of the variants of coreboot is Libreboot, which is free of proprietary blobs. A proprietary blob, called blob or binary blob, is a proprietary software that is only available as a binary executable.

GNU GRUB

GNU GRUB, acronym of GNU GRand Unified Bootloader, is an application that allows to select the operating system to load when there’s more than one operating system installed on the same computer.

GRUB can be configured to start all the operating systems installed on the computer. It detects them automatically, but they can be added manually to the configuration file. The configuration file is /boot/grub/grub.cfg.

The background image, among other options of GRUB, can be changed too.

Configuring the hard-drive

Syslinux

Syslinux is a software suite that allows to start a Linux distribution from every place, without necessarily installing it.

UNIX

UNIX is the predecessor of Linux operating systems. It has been created by Dennis Ritchie, Ken Thompson, among others inside Bell Labs in 1969 and announced outside Bell Labs in 1973. Most of the basic functionalities of UNIX have been the base for Linux distributions. UNIX has proprietary and free versions. Currently, UNIX operating systems are measured as compliant or not through the Single UNIX Specification.

Although currently UNIX is not used anymore in proportion to Linux distributions, it’s important to know how it’s in order to understand Linux deeply, because it’s the base from which Linux has been developed, and most of the functionalities of UNIX are still functionalities inside Linux.

Unix directory structure

The directory structure of Unix operating systems is the following:

Unix 1

The first version of UNIX, released on november 3 of 1971 was including the following commands:

The system call of UNIX 1 are the following:

The library routines of Unix 1 are the following:

The special files of Unix 1 are the following:

The file formats of Unix 1 are the following:

The user-maintained software is the following:

Unix 2 to Unix 6

The following changes have happened with the next editions of Unix, the version 6 in total was including the following changes compared to Unix 1:

Commands

System calls

Subroutines

Special files

File formats and conventions

User maintained programs

User maintained subroutines

System maintenance

UNIX 7

Basic software

Text processing

Information handling

Graphics

Novelties, games and things that didn’t fit anywhere else

UNIX 8 to UNIX 10

systemd

systemd is the program that loads all services of a Linux operating system when it starts. It also allows to configure devices, login, network connections and event logging. It’s the replacement of SysV init, the booter of UNIX. It’s similar to sysv init in many aspects, but it has evolved to include more functionalities and to allow more control of the operating system.

The package systemd of Debian includes the following important programs:

Base packages of Linux distributions

The base packages of Linux distributions mandatory to know are the commmands of UNIX, GNU binutils and GNU coreutils.

Users, groups and permissions

Users are stored in the file /etc/passwd. The following commands are used to work with users:

The following commands are used to work with groups:

Groups are stored in the file /etc/group, you can see all groups of the OS there.

The id of a user in Linux is abbreviated as UID, the id of a group is abbreviated as GID.

Processes and threads

Desktop environments

It’s called desktop environment the graphical display that allows the user to use an operating system, it’s what appears on screen when the operating system is not executing a terminal. When there’s no desktop environment but it’s possible to type commands, the computer is then executing a terminal, from which, inside a Linux distribution, it’s possible to execute a desktop environment.

Inside Linux there’re different desktop environments, the most important ones are the following:

You can search images on Google of each desktop environment, and select the one you prefer.

There are more desktop environments, because inside Linux there are a wide amount of FOSS developers who develop new software available for everyone. Just search inside Google and install the desktop environment you prefer.

As part of the desktop environment there exist the display manager. The display manager handles the display of the monitor. There are different ones to choose:

A display manager can be configured with one or another greeter. A greeter is the interface that prompts the user for credentials. For example, lightdm has a wide amount of greeters, one of them is lightdm-gtk-greeter.

Linux directory structure

The main directories of Linux distributions are the following:

Other directories of Linux are the following:

The Linux command-line

Environment variables

An environment variable is a variable that allows to configure some value of the operating system that can be read by all the processes that the operating system executes and that have the permission of the operating system to access that environment variable.

Using the filesystem

To use a command in Linux, just type it in the command line. All commands have arguments, and you have to write them after the name of the command. To use the filesystem inside a terminal of Linux the following commands are mandatory to know:

BASH

BASH, acronym of Bourne Against SHell, is the default terminal in Linux. It allows to create chains of commands, where one command gives its output as input to the next command. To do that, the character **’ ‘** must be used. That’s what’s called a pipe.

Another important feature of bash is the use of > and < within commands. Those characters are used to add the output of a command to a file in order to create a new file with all the output. Also, it can be used to give the text of a file as input for a command.

man and info

man is an application created by Dennis Ritchie to document software. It’s executed from the command-line by typing ‘man <program>‘. The data files from which the documentation is read is stored in the folder /usr/share/man.

The different sections of man pages are NAME, SYNOPSIS, DESCRIPTION, OPTIONS, FILES, ENVIRONMENT, DIAGNOSTICS, BUGS, AUTHOR, SEE ALSO.

Texinfo is a software of GNU created by Richard Stallman and Robert Chassell that allows to generate documentation files on different formats like HTML, DVI, PDF, Docbook, XML and Info. info is an application that’s similar to man and that can read info files generated by texinfo. It’s used by GNU, and it’s, as man, widely used inside Linux distributions. As man, it’s used by typing ‘info <program>‘. The data files of the documentation of programs is stored in the folder /usr/share/info.

Important tools

Very important command-line utilities for Linux are the following:

Knowing the hardware

The following tools give information about the hardware:

Linux packages

A Linux package is a file containing all the files of a software or software suite, which includes binaries, libraries, configuration files, documentation files, documentation files of the authors, among any other required file.

The two widely used Linux packages are deb files and rpm files.

Installing software

To install software in Debian, Ubuntu, and other Linux distributions, apt is used. Apt is an acronym of Advanced package tool. Apt is configured in the file /etc/apt/apt.conf. Inside fedora, among other distributions, instead of apt it’s used yum. The application that installs packages varies with the Linux distribution, and so it’s needed to read the documentation of the distribution in use to know how the packages are installed in it.

The sources from which apt downloads the packages are specified in the file /etc/apt/sources.list. The packages for Debian distributions are downloaded mainly from http://ftp.us.debian.org/debian.

Debian packages have the following applications available:

Linux distributions

Linux organizations

Apart from those organizations, and any open source software that you can find in, for example, GitHub, there exist the following important open source organizations, not related specifically to Linux, but mandatory to know:

Logs

Core Linux libraries

The central libraries to develop software in Linux are, currently in 2023:

The Linux Standard Base (LSB) has been created to have some compatibility between different Linux distributions.

GUI libraries

The central libraries to create the GUI of desktop programs in Linux are:

To create a GUI library

Important Linux applications

Archives

Archives are files containing more than one file inside.

Programming tools

Code editors

Linux API and ABI

Linux kernel modules

Linux system calls