There's strictly no warranty for the correctness of this text. You use any of the information provided here at your own risk.
"Linux" is a computer operating system. To be exact, "Linux" is just the kernel (the core), the whole operating system is called "GNU/Linux". But this is even debated, and we ignore it, so we just call operating system, this page is about, "Linux".
Most Linux-software is socalled "free software". What that means is explained in detail on my other page about Linux. One principle of free software is, that the program sources are openly visible to everyone, so it is mainly open-source software.
Linux is somehow a free clone of the earlier, commercial operating system "Unix", which goes back to the very early days of computing in the 1970s. So many concepts of Unix, like its multi-user system or its directory tree can be found in Linux too.
The Linux software is packed into socalled "distributions". Distributions contain the Linux operating system, but also Linux applications. So when installing a Linux distribution, you basically install all the needed software at once. Of course, you can remove programs you don't want, or add other programs to your installation. It's relatively easy to add programs that are part of the distribution, but it may be more difficult to install other programs that aren't part of the installed distribution, but can be found somewhere else on the internet.
Today, popular Linux distributions are for example:
In an installed system, the Linux software is packed into socalled "packages". The locations of the files in the directory tree and their affiliations to the packages are stored in a database. There are two different types of these database systems. One uses the program "rpm" ("Redhat Packagage Manager"), the other one "dpkg" ("Debian Package Manager").
There are larger distributions, which contain a huge collection of software packages, and smaller, reduced distributions, which just contain smaller selections, for example a single application for a certain task.
I've been using OpenSuSE for many years, version 15.6 at the moment. It always worked well with my hardware, and I was always content with it.
Today, many people start with Ubuntu and Linux Mint. But I would recommend a larger distribution, at least Debian, because then it's easier to add other software later, in case you want to use other programs than those in the preselected Ubuntu- or Mint-packages.
Regarding the most common Linux software, the distributions basically contain the same programs. For example, they offer "Firefox" for web-browsing, "LibreOffice" for word-processing and spreadsheet-tasks, "Audacity" for editing sound, and "GIMP" for editing images.
That means, the distributions may look a bit different here and there, but in the end, they don't differ as much from each other as one may think at first.
Today it seems, there is some campaign to make new users coming from Windows install Linux Mint. But I don't see any major advantages of Linux Mint over other distributions like for example OpenSuSE. As mentioned, Linux Mint is a reduced distributions, the larger ones like OpenSuSE offer a much wider selection of software. Which makes things easier, especially for beginners.
Some years ago, everybody was talking about Ubuntu. I didn't see why either.
A very good and well-known reference book about Linux is: "Michael Kofler: 'Linux: The Comprehensive Guide'" (in German "Michael Kofler: 'Linux: Das umfassende Handbuch'"). It is quite large though.
The notes about the installation process of a Linux distribution got in the way a bit here. You can find them here.
So after the installation the user finally gets to the desktop. There's probably a task-bar at the bottom, or for example a file dock. Clicking the menu button in the task bar opens a menu, where programs like Firefox can be opened.
In the menu, also programs can be found to customize the look and feel and change system settings.
There are certain customizations, I like to make on my Linux systems. I wrote pages about that topic regarding OpenSuSE Leap 15.6 and SuSE Linux 13.1 (which was the system on my previous computer; some of the notes may still be relevant today though). These pages may be of more interest for you, when you already have a little more experience with Linux.
There are certain applications that are typically used for certain tasks on a Linux system today. Here's an overview:
vim and Emacs are the two classic text editors on Linux. They are both very powerful, but also very unfamiliar to beginners. Both are also very different from each other. The other text editors use the key combinations known from Windows Notepad and such.
Let's say, you created a text document with LibreOffice. Then you want to save it and select "File / Save As" as usual. Then, you're asked for the location to store the file, so the directory tree is presented to you.
It looks unfamiliar, because it uses slashes ("/") instead of backslashes to separate the directories, and there isn't a drive (like "C:\") at the top, just an ordinary slash.
Where should you save your file?
Well, during the installation process, a user is created. He has a name and a password. And he also has his own directory in the directory tree, which has been assigned to him during installation.
The user's directory is called "/home/username". So if there's a user with a username "john", his files would be below "/home/john".
Notice, that unlike Windows, Linux is always case sensitive. That means, "/home/john" would be something else than "/home/John". They would both exist and would be two completely different directories.
Inherited from the Unix-tradition, the Linux system manages the users and the rights they have to the files.
To each file and directory user-rights are stored. There are three kinds of permissions: To read (r), to write (w) and to execute (x). And there's an ownership to each file and directory.
If "john" creates a file "hello.txt" (for example in or below his directory called "/home/john"), he becomes owner of that file and can set the file-rights for others, that is, determine, if others are allowed to read, write or execute the file.
Then, there's a special user, who is the system-administrator. His username is always "root". root is allowed to do everything on the system. He can even easily delete system-files, that are essential for the system to run. So root is allowed to break the system in any way.
root can also access all files of all users, no matter what user-rights they have set.
And root can also set the user-rights for the owners of files. These are again read (r), write (w) and execute (x).
If "john" owns a file, "root" can change that, he can give ownership to himself or to a third user, like "paul" maybe. He can also withdraw john's permission to read his own file, for example.
Users can also be members of groups. For groups, there are again the three rights mentioned.
So all in all, the user-rights, that are stored with the file, are: "rwx (owner) rwx (group) rwx (others)".
An example: Let's say, "john" creates the file "hello.txt". It contains somehow secret text. He, himself, wants to be able to read and write the file, but not to execute it, as it's a text-file. Groups and others shouldn't be able to do anything with the file. So, he would set the rights for the file to: "rw- --- ---".
Directories can only be accessed, if the right "execute (x)" is set for them. "john" has his home-directory "/home/john", and "paul" has his home-directory "/home/paul". If the "x"-right of john's home-directory is withdrawn for groups and others, and "paul" tries to switch to "/home/john", he will fail and get an error about lacking permissions.
This system of user-rights contributes to the security of the Linux-system.
It also improves the security when it comes to viruses. At the moment, viruses aren't that much of a problem for Linux-systems anyway, because globally there are much more installations of Windows-systems, so developers of viruses are more interested in attacking Windows.
It is also possible to run a Linux-system with just a single user. This user will also have to be the system-administrator "root" then. For security-reasons it is recommended though, to use an account for a normal user as well then. So one person can have multiple accounts on a Linux system, for example one account for an ordinary user, and one account for "root".
If you run a single-user-system, you usually work as an ordinary user. Only when you have to change system-files, you become "root" for a short while. This is done with the command "su" on the shell ("su" is an abbreviation of "superuser").
In the directory tree, the files of a user are in his home-directory, so john's files are in "/home/john".
Only the user "root" has the write-permission for most system-files, which are outside of "/home".
The top level directory (= the directory tree's root) is at just "/". If you use one of the file-managers listed above (dolphin, for example), and point it at "/", you may see some of the following directories:
bin boot dev etc home lib media opt proc root tmp usr var windows
These directories have the following contents or meanings:
The Linux directory tree is not connected to a certain diskdrive (like Windows "C:\"). Instead, the files, from which Linux is booted, are spread across the whole directory tree. Most of them are system-files. If the files of an external drive or a USB-stick are needed, they will be found below "/media" or "/mnt", where the drive or stick will be mounted.
Ordinary users usually stay in their home-directory ("/home/john" for user "john"). They can create a (nearly) unlimited number of own sub-directories there.
From their home-directory, users can execute programs though that are found in the directories "/usr/bin" or "/usr/local/bin". Because of the $PATH-variable, they don't have to switch to these system-directories to execute these programs.
They can stay in their home-directory, and the system finds the programs for them.
When you see the Linux directory tree for the first time, it surely will be very unfamiliar to you.
"What on earth is that?", you may ask.
But consider: Most of its directories contain files of the type, Windows usually hides from you in "C:\Windows\System". When was the last time, you looked into that directory?
And: If you continue using Linux, you will get used to its directory tree in maybe a few weeks. But it has been around for decades. It probably will be for some more decades.
So, the knowledge about the Linux directory tree is one of those things, you learn for life. You may teach it to your grandchildren one day.
On Linux, there are several socalled "window managers". These are programs that are (in connection with another program called "X server") responsible for creating the graphical desktop.
(For comparison: On Windows, the code for managing the window-system is part of the operating system and doesn't have a special name. As a result, there's only one type of Windows desktop available to the user.)
These window managers are combined with other software to a socalled "desktop environment". The most common ones on Linux are:
KDE and Gnome are the biggest desktop environments, the others are more lightweight. I'm quite happy with Xfce (version 4) at the moment.
So the graphical desktop of a Linux-system is not fixed. There are many ways it can look.
Nevertheless, the principles of the Linux system, that is the directory tree, the managment of the users and their rights, and the system-administrator "root" always apply, independently from the used desktop environment.
It is also possible to install multiple desktop environments on your Linux-system. Then you can just use one of it, for example Xfce. But you can then also start applications from within Xfce, that are written for KDE or Gnome, for example. So you don't have to do without KDE- or Gnome-applications, when you're running other desktop environments than KDE or Gnome.
Ubuntu's default desktop environment is Gnome. There are other flavours of the distribution that uses one of the other ones: There are "Kubuntu" (KDE), "Xubuntu" (Xfce) and "Lubuntu" (LXQt). Ubuntu's default environment used to be "Unity", which tried to combine elements from KDE and Gnome. But as said, the distribution switched back to just use Gnome.
This is a good example of the difference between a reduced distribution (like Ubuntu or Linux Mint) and a large one (like OpenSuSE): On OpenSuSE you can choose one of those four desktop environments during installation, or you can install several (or all four of them if you want), and choose the one, you want to use, at the graphical login-screen.
While Ubuntu just offers a single desktop environment. And if you want to use another one, you can't just install it in addition (at least not easily), but have to install a different distribution from the Ubuntu-range (which again is a reduced one).
Linux Mint uses a similar approach like Ubuntu: Its default distribution is "Linux Mint Cinnamon", which uses the desktop environment "Cinnamon" (with the window manager "Muffin"). But there are also the more lightweight distributions "Linux Mint MATE" (with the window manager "Marco") and "Linux Mint Xfce".
The way, the windows of Linux applications look, is defined by certain software-layers called "GUI-toolkits". There are:
These GUI-toolkits are software libraries that provide code for creating socalled "widgets" (= "window gadgets"). Widgets can be for example buttons, entry-fields, sliders or checkboxes. When writing a graphical application, the toolkit-library is accessed to create such widgets, which then define the look and the behaviour of the application's windows.
(By the way: Microsoft Windows also has a GUI-toolkit, respectively a software library to create widgets. There's the old "Windows API", and the "MFC" ("Microsoft Foundation Classes"). It's just, that the average Windows-user doesn't come in touch with these internals of the operating system.)
On Linux, there's a special way to drag windows:
You can press the "Alt"-key, click on a window at a any location (not only on the window title) and keep the left mouse-button pressed. Then you can drag the window around at the same time.
This is a very useful feature, as you can drag windows way outside the screen this way, if it should be necessary. Which in some cases it is.
Maybe it's time to open a terminal program. You should find one in the menu of the task bar in the section "System".
A terminal program (also called "console") lets you enter commands, which are then executed. The commands are interpreted by a program called "shell". That way, the user is provided with a "CLI" ("Command Line Interface").
The term "terminal" goes back to the very early days of computing, and then described electronic devices that only could send data to a central computer, get back its output and display it somehow. Several of those terminals - which weren't computers themselves - could be connected to one large central computer. Which could deal with several terminals and users at once, because it probably ran Unix. This video explains, what the vintage hardware terminals were about.
The terminal programs on a modern Linux computer are of course just virtual emulations of those old machines, and don't have much in common with them except their purpose.
There are several terminal programs for Linux. There are "xterm" and "rxvt". "konsole" is KDE's terminal, "gnome-terminal" the one of Gnome. As I'm using Xfce at the moment, I'm using "xfce4-terminal", and am quite happy with it.
Make sure, you like the terminal's settings, especially the main font and its size. Letters in the terminal should be as easy to read as that in a web-browser.
If the terminal opens and runs fast, if the font and its size can be set, and if the settings can be kept for the next time, then it's a good terminal. "xfce4-terminal" is good in that sense. Not all of the others are.
It's also necessary, to be able to open and close the terminal quickly. I suggest at least putting the terminal's icon on the desktop. But it's even better to define a keyboard shortcut that opens the terminal. How this is done, depends on what window manager is used. I'm using the keyboard shortcut "Alt-d" to open the terminal (including all of its user-defined settings).
"Ctrl-d" works by default to close it (as this shortcut is used to log out from the active shell).
So on my system "Alt-d" opens the terminal, "Ctrl-d" closes it. That's very fast, and well usable.
Now that the terminal is well configured, it's time to enter something. As mentioned, in the terminal, a program called "shell" is running that interprets the commands, the user enters. The default shell on Linux is "bash" (although there also are a bunch of others like "sh", "ksh", "tcsh", "zsh"). Here a some basic commands in bash:
About deleting files: Files are deleted with the command "rm" (remove). It's used with the option "-r" to delete directories. There is no safety catch here (like a "recycle bin" or such). Basically, removed data is lost forever. So you are yourself responsible for not deleting your data by accident. Someone once said, in a way, at this point Linux hands you a loaded gun and doesn't protect you, if you shoot yourself in the foot. So be careful with that.
There are lots of options to the shell-commands. You can get help on them if you type "man" and the command's name ("man" for "manual"), like "man ls", for example.
There are some important key combinations in the terminal:
One feature of bash makes it especially usable. It is called "tab-completion": If you enter a few letters of the name of a command or a file, you want to use, and press TAB then (the tabulator-key), bash automatically completes what you wrote to the command-name or the file-name, it thinks, you wanted. So you don't have to type in all of the filenames. Just a few letters, then TAB, and in many cases, you're done. If several names are possible, bash shows them, when you press TAB twice.
Also, a few symbols can be used in the shell:
So,
mv ./myfile.txt ~
means: "Move the file 'myfile.txt' from the current directory to my home directory."
The symbol "&" can be added to a command, to open the called program in a socalled "sub-shell", and to not block the current shell. For example, the command "firefox &" opens Firefox, and doesn't wait for it to finish, but lets you continue to use the current command prompt.
Pipes and Redirection
The outputs of bash-commands can be redirected. For example, the command
echo "Hello World"
prints the string to the screen (to the console). But the output can also be redirected with the symbols ">" and ">>" into a file (called "test.txt" - if there already is a file "text.txt" in the directory, it is overwritten) here:
echo "Hello World" > test.txt
You can check the result with "cat test.txt".
Important: Another use of ">" would overwrite the file.
But using ">>" would append more text to the file:
echo "Hello to everybody" >> test.txt
So after that, the output of "cat test.txt" would be:
Hello World Hello to everybody
The output of a command can also be redirected to another command, using the symbol "|". Redirecting in that way is called a "pipe".
The command "wc" can count words, lines or characters of a string. This command is typically used in a pipe, for example to count the words in a string like this:
echo "Hello World" | wc -w
The result is "2" (as there are two words in that string).
Some background on creating a pipe (which is still basic bash-knowledge): There's a "stream" called "stdout", programs can write to. And a stream called "stdin", from which programs can read in data. Creating a pipe uses these two streams: Without additions, the command 'echo "Hello World"' writes to "stdout", which leads to displaying the string on the screen (in the terminal). The command "wc" reads data from its "stdin". The pipe-symbol "|" redirects the output of "echo" from its "stdout" to the "stdin of "wc".
Accordingly, the symbols ">" and ">>" redirect the output of "echo" from its "stdout" into a file.
Another example: The tool "bc" can do calculations (its program package, which should be part of the distribution, may have to be installed first). Then, the line:
echo "25 * 5" | bc
produces an output of "125".
Quick Introduction to bash-Scripting
Shell-commands can not only be passed on the command-line, but they can also be written into a text-file, which is then executed as a script.
So bash is in fact a programming-language. Among other things, bash-scripts are often used as installation-routines. They also play an important role in the Linux boot-process.
Here's a quick introduction, how bash-scripting can be done.
Consider a text-file called "examplescript.sh" with this content:
#!/bin/bash
# examplescript.sh - Example of a bash-script.
echo "Let's count to 10:"
for (( i=1; i<=10; i++ ))
do
echo "$i"
done
Then the text-file can be made executable with this command:
chmod +x examplescript.sh
And after that, the script can be executed with:
./examplescript.sh
Here's a quick overview of what Linux software I'm using:
vim ("vi improved") is a powerful text-editor.
It's an open-source clone of the Unix-editor "vi" ("vi" for "visual").
Usually, it's run on the console, so to use it, the terminal program should be configured in a way, that letters can be read easily.
At first, vim seems very unfamiliar, but with a little practice, using it becomes actually quite easy.
The console version of vim is installed by default on all good Linux systems (and the ones, where it's not installed by default, aren't good). There's also a graphical version using a GTK-interface called "gvim", but on Linux, the console version is perfectly sufficient.
This page was written with vim on the console.
There are two basic modes in vim, a "command mode" and an "insert mode".
vim is started with
vim file.txt
in command mode. That means, text can only be entered, if the mode is switched to insert mode. This is done by pressing the key "i". Pressing the key "Escape" switches back to command mode.
A file can be saved, by entering ":w" in command mode.
":sav f2.txt" does "Save as", also overwriting an existing file.
vim can be exited without saving by entering ":q!" in command mode. Entering ":wq" saves the file and exits vim, which is pretty straightforward.
The cursor can be moved "left, down, up, right" with the keys "h, j, k, l", but the cursor keys also work.
"^" pressed in command mode moves the cursor to the beginning of the line, "$" moves it to the end of the line. "w" moves the cursor one word further, "b" moves it one word back. "gg" in command mode moves the cursor to the beginning of the document, "G" moves it to the end of the document.
When pressing "%" in command mode, while the cursor is on a bracket, moves the cursor to the corresponding bracket.
Copying and pasting text works as follows:
"y$" in command mode copies the text up to the end of the current line into a text buffer. "10y$" copies the next ten lines. "yG" copies the text from the cursor position to the end of the document. "yw" copies one word, "5yw" the next 5 words.
Then, "p" is used to paste the text from the buffer into the document at the current cursor position.
There's also a "visual mode", which is entered pressing "v". In this mode, text can be selected, for example with the cursor keys. Then commands like "y" (copy), but also "d" or "x" (cut) can be applied to the selected text. By pressing "v" again, the visual mode can be left again.
It's also possible to switch into insert mode with "i", and then copy text from other applications into the document by pressing the middle mouse button.
"dd" deletes the current line. "dw" the current word up to its end. Text that is deleted that way, is also copied, so it can be pasted elsewhere using "p".
"u" undoes the last action.
"Ctrl+r" redoes the last action that was undone.
"/expression" searches the document for "expression"
"n" finds the next occurence of the expression.
If there are special characters in the expression like "." or "/", a backslash has to be written in front of them.
With the command ":set ignorecase", case sensitivity is switched off for search operations.
:% s/expression1/expression2/gc"
replaces "expression1" with "expression2" throughout the document, but asks the user before replacing.
With ":set nu" line numbers are shown, with ":set nonu" they're hidden again.
"a" moves the cursor behind the current word and switches to insert mode.
"o" moves the cursor one line down and switches to insert mode.
"x" deletes the current character.
"r" in command mode replaces the current character with another one without changing to insert mode.
"cw" deletes the current word and switches to insert mode.
"." repeats execution of the last command.
"J" joins the next line to the current one (This command is used more often than one might expect).
":r file.txt" loads the content of "file.txt" into the document at the current cursor position.
"gU" in combination with a movement of the cursor (like "w") changes the characters of the word into capital letters.
"gu" in combination with a cursor movement (like "w") changes them to lowercase letters.
This also works with other movement commands, for example "gUG".
The options and configurations of vim are saved in a file "/home/user/.vimrc".
A line in that file
iab ts test
has the effect, that if the word "ts" is written in the document followed by a space character, the word is replaced with "test".
The entry "set backspace=2" in "/home/user/.vimrc" has the effect, that the backspace-key can be used beyond the beginning of the current line (which is the default behaviour in other editors).
If vim at first doesn't behave the way you expect, you may find a configuration file for it on the internet that contains just the option, you're looking for.
To be continued ...