Using Linux

Date: 2026-02-22


There's strictly no warranty for the correctness of this text. You use any of the information provided here at your own risk.


Contents:

  1. Introduction. Distributions
  2. Installation
  3. First Look Around
  4. Managing Files. Multiple Users and User-Rights. System Administrator "root"
  5. More about the Linux Directory Tree
  6. Desktop Environments. Window Managers. GUI-Toolkits
  7. Dragging Windows
  8. Terminals. Shells. Pipes. bash-Scripting
  9. Copying and Pasting Text
  10. Typical Linux Applications I'm Using
  11. Editor vim
  12. grep: Filtering Text (From Output or in Files)
  13. Managing Processes
  14. su and sudo: Acting as "root"
  15. zip, tar: Unpacking and Packing Files
  16. df and du: Information on Disk Space Usage
  17. Making Commands and Scripts Available to All Users
  18. alias: Defining Smaller Commands
  19. dos2unix, unix2dos, recode: Reformatting Text-Files
  20. ln: Symbolic Links
  21. date, cal: Showing Date and Time
  22. find, locate, updatedb: Finding Files or Directories
  23. mount, umount: Mounting Devices
  24. rpm: Managing Software Packages on a rpm-Based Distribution
  25. X-Server. Tools xrandr, xwininfo, xfontsel, xev, xmodmap, xkill, xkbset
  26. Login-Manager
  27. Autostarting Programs Together with the Graphical Desktop
  28. Playing and Editing Videos
  29. Midnight Commander
  30. lpq, lprm, xsane: Managing Printers. Scanning
  31. cron-Daemon, at: Run Programs at Other Times
  32. lsmod, modprobe, rmmod: Managing Kernel Modules
  33. Making Changes to the Configuration of the Bootloader GRUB2
  34. Customizing the Linux Installation
  35. bash, Perl, Python, C, C++: Finding Your Way into Programming (If you want)
  36. Legal Topics: The Principles of "Free Software". The GNU General Public License (GPL)
  37. Recapitulation
  38. Notable Files and Directories on a Linux System. Conclusion


1. Introduction. Distributions

"Linux" is a computer operating system. To be specific, "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 one of the last sections of the page. 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.


2. Installation

The notes about the installation process of a Linux distribution got in the way a bit here. You can find them here.


3. First Look Around

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 applications that are typically used for certain tasks on a Linux system today. Here's an overview:


4. Managing Files. Multiple Users and User-Rights. System Administrator "root"

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").


5. More about the Linux Directory Tree

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. 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 can be found in the directory, where the device is mounted. That location can be "/media" or "/mnt", it may also be "/var/run/media/username".

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, proprietary operating systems usually hide from the user completely. When was the last time, you looked for such files on other operating systems?
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.


6. Desktop Environments. Window Managers. GUI-Toolkits

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.)


7. Dragging Windows

On Linux, there's a special way to drag windows:
You can press the "Alt"-key, click on a window at 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.


8. Terminals. Shells. Pipes. bash-Scripting

Maybe it's time to open a terminal program. You should find one in the menu of the task bar in the section "System" or "System Tools".
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 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's a command "wipe" that deletes files in an even more secure way than "rm" by also overwriting the files' data.

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.

The command "ls -lisa somefile" can show more information about the file "somefile", especially its size.

There are some important key combinations in the terminal:

Two features of bash make it especially usable.

  1. With the cursor keys "Up" and "Down", the user can cycle through the previously entered shell-commands. The entered commands are stored in the file "/home/username/.bash_history".

  2. "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.

With the symbol ";" several commands can be separated on the command-line. That makes it possible to enter several commands in one line: "echo "one"; echo "two"".

Space Characters, Shell Expansion, Variables, Using Quotation Marks

In the shell, the space character separates file-names (and also commands and options). That means, file-names that contain space characters themselves have to be put into quotation marks to be recognized correctly by the shell.

Before the shell executes a command, it does something called "shell expansion". The symbols that were used on the command-line (for example "*") are expanded to what they represent (for example file-names).
Also, variables can be used in the shell:

a="Hello World"; echo "$a"

Because of the meaning of the space character explained above, variables should also be put in quotation marks as shown, when used in the shell. Because they could be expanded to a string containing space characters, and as mentioned such strings should be handled in quotation marks.
Using single quotation marks tells the string to not perform shell expansion on the expression: "echo '$a'" doesn't expand the variable, but literally prints the string "$a".

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): The operating system assings socalled "streams" to a program. A program has a stream "stdout", to which it can write. And a stream "stdin", from which it 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".

Longer output of a command is often piped into a small program called "less", which is a text-viewer on the console. For example:

echo "Hello World" | less

or

ls -lisa /home/username | less

The cursor keys "Up" and "Down" can be used to move around in "less". And "q" to quit.

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

There's a separate page about bash, where these topics are explained in more detail.


9. Copying and Pasting Text

The Linux-way to copy and paste text, works as follows: When selecting text with the mouse, the text is automatically copied to a system-wide text-buffer. While the text is still selected, the cursor can be positioned at a different position, or even in another window of another application. By pressing the middle mouse-button, the text is then pasted from the text-buffer to the window that has the window-focus at the position of the cursor.

But the "Ctrl+c, Ctrl+v" known from Windows often works too. That seems to be a second mechanism.


10. Typical Linux Applications I'm Using

Here's a quick overview of what Linux software I'm using:


11. Editor vim

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.


12. grep: Filtering Text (From Output or in Files)

"grep" is an often-used console program. It filters lines of text from the output of other programs. It can also filter lines from text files. Consider this command:

echo -e "one\ntwo\nthree\nfour\nthirty"

It prints "one two three four thirty" in five lines. "\n" is the newline-character on Linux.
Now let's pipe the output of this command into "grep", and make it filter all lines that contain "th":

echo -e "one\ntwo\nthree\nfour\nthirty" | grep "th"

The result is "three thirty" (written in two lines).

"grep" has an option "-i", which makes it ignore case sensitivity.
There's also an option "-v", which makes "grep" output only those lines, that don't contain the passed string. So with the "-v" option, the result of the command would be "one two four" (written in three lines).

"grep" is often used in combination with the command "find", which prints the names of all files and directories in and below the current directory. So if you're looking for a file called "test.txt" somewhere in or below the current directory, you could run

find | grep "test"

and it may print the location of the file.

"grep" can also be used on files, like "grep -i hello test.txt". That would print all lines in the file "test.txt" that contain "hello" or "Hello".
There's also an option "-r", which makes "grep" search recursively for files, and apply the filtering to their contents.


13. Managing Processes

The command "ps" lists the processes that are running at the moment. Without options, it only shows the user's processes related to the user's terminal.

ps xa

lists all processes. As this list of processes can be quite long, it's useful to use "grep" together with "ps". For example: Start Firefox, open another terminal and run:

ps xa | grep -i firefox

That should show a number of processes related to Firefox.

In the first column of the list, the "process ID" (PID) of each process is shown. This PID can be used to kill a process. This is for example useful, if the process is broken and doesn't react any more. The command "kill -9" is then used in combination with the process' number (the PID).
There's also a command "killall", which can be used in combination with the name of the program, for example "firefox".

A graphical list of processes, sorted by CPU- and memory-consumption, is displayed by the command

top

"top" can be exited by pressing "q".

Today, it seems, there are also graphical task managers, like for example "xfce4-taskmanager" for Xfce.


14. su and sudo: Acting as "root"

Often, it's not sufficient to run tools and programs as an ordinary user.

To become "root", the command "su" ("su" for "substitute user" or "switch user") can be run on the console. After entering root's password, the user's identity is then changed to "root", and it's then possible to work with system-files. Of course, the person who has root's full system-access should act with care, or things may get broken.

There's also a system to enable an ordinary user to just run certain commands as root, without becoming root for a longer period of time. The user can enter "sudo somecommand", and if it was predefined that he's allowed to run "somecommand" as root, he can.

root can define with the command "visudo", which commands users can run with "sudo". This command changes (on OpenSuSE Linux) the file "/etc/sudoers". To use "visudo", root should be familiar with how the editor "vim" is used - which is described in another section on this page.
The entries in the file "/etc/sudoers" have the following format:

username computername= NOPASSWD: command

Where the command "hostname" tells the name of the computer.

So if root defines the line

john linuxbox= NOPASSWD: /usr/sbin/userdel

with "visudo", the user called "john" can run the command "/usr/sbin/userdel" as "root" on the computer called "linuxbox" by writing "sudo /usr/sbin/userdel".

On my system, I hardly mess with "sudo", but just become root with "su", and I'm good to go.


15. zip, tar: Unpacking and Packing Files

".zip"-files can be unpacked with:

unzip somefile.zip

A new ".zip"-file can be created from a directory with:

zip -r archive.zip somedirectory

On Linux, archive files are often in the format ".tar.gz" or ".tgz" (tar: "Tape Archive", gz of "gzip"). These files can be unpacked with:

tar -xzvf archive.tar.gz

There are also archives in the format ".tar.bz2". They can be unpacked with:

tar -xjvf Datei.tar.bz2

And there are archives in the format ".tar.xz". They can be unpacked with:

tar -xf Datei.tar.xz

A ".tar.gz"-archive can be created from a directory with:

tar -czvf archive.tar.gz somedirectory

"mc", the Midnight Commander, can also handle archive files. It can be used to browse archives or extract single files or directories from them. It can also add files or directories into already existing archives.


16. df and du: Information on Disk Space Usage

The command "df" shows the mounted file systems, how much space is used on them, and how much is still available.

The command "du" shows, how much disk space the files in the current directory and below it use. You can also pass the name of another directory to be examined to it. There's an option "-h" to make the output of "du" better readable for humans. So, typically "du" is used like this:

du -h .

With the point symbolizing the current directory.


17. Making Commands and Scripts Available to All Users

There's a mechanism, where the shell looks for commands.
In the shell, there can be variables. They are for example defined and used like that (the code should be entered one line after the other here):

a="Hello"
echo "$a"

Notice, there aren't space characters left and right to the equal-sign (if there were, it wouldn't work).
Also notice, that the variable is used with the dollar sign in front ($a), but defined without it.
And then, it's a good idea to use quotation marks around the variable, when using it ("$a"), because of shell expansion (which was already described above).

There are also system variables, which are predefined by default. There is a system variable "$PATH". On my system, executing "echo "$PATH" leads to this result:

/home/user/bin:/usr/local/bin:/usr/bin:/bin

So the system variable "$PATH" contains the directories, where the shell is looking for the commands, separated by colons.
That means, if "." isn't in "$PATH", a command (for example a script called "somescript.sh") that is in the current working directory, can't be executed by just typing its name. Instead, a point and a slash have to be entered in front of its name, to tell the shell, that it is the command in the current working directory, that should be executed. So writing

./somescript.sh

would execute the script (provided, that the file attribute "executable" is set - which can be done by running "chmod +x somescript.sh").

One of the directories in "$PATH", where the shell is looking for commands, is the directory

/usr/local/bin

This setting can be found in most Linux-distributions. So if you've written a script, made it executable, and want all users to be able to execute it on the console, you can just copy it as root to "/usr/local/bin". Then the shell finds it, regardless of the current working directory.

The shell-command "which" tells, in which directory an available command is located. For example prints the command "which ls" the string "/usr/bin/ls".


18. alias: Defining Smaller Commands

As mentioned, larger scripts should be made executable, and then put into "/usr/local/bin".
Smaller commands can be create as "aliases". For example, the command

alias show_usrlocalbin="cd /usr/local/bin;ls"

defines an alias called "show_usrlocalbin" that executes the part in quotation marks. So after running the alias-command, you can use a new command "show_usrlocalbin" to print the contents of that directory. Of course, this is only an example of what can be done with "alias".

For now, the new command is only available in the current shell. So when you close the terminal, the alias is gone again. To make the alias permanent, it can be written into the file

/home/username/.bashrc

This file is executed, every time the shell is started, that is when opening a terminal.
The leading point of the filename ".bashrc" means, that the file is hidden. It is not visible to a simple "ls". It is visible to "ls -lisa" though, so these files aren't completely hidden from the user. Such hidden visibles are mostly configuration files. Typically, they can be found in the directory "/home/username".
Today, there's also often a directory "/home/username/.config". This directory contains the user-specific configration files of applications.

Writing the alias-line into "/home/username/.bashrc" makes the new command available to the specific user.
Writing it as root into the file

/etc/bash.bashrc.local

makes it available to all of the system's users. It may be necessary, to create this file first. Alternatively, the file "/etc/bash.bashrc" can be used.


19. dos2unix, unix2dos, recode: Reformatting Text-Files

On Linux, the character for "End of Line" is "\n".
DOS and Windows use a different character. So when exchanging text-files with these systems, the files have to be reformatted. This is done with the commands "unix2dos" and "dos2unix".

Text-files also have a certain encoding. This is of importance for text-files in other languages as English, for example in the German language, which may contain vowels such as "ä" and "ö".
The most common encodings are "ASCII", "ISO-8859-1" and "UTF-8" (which is related to Unicode).
The command "file textfile.txt" gives information about the encoding of a text-file.
The encoding can be changed with the command "recode". For example this command can be used to recode a text-file from "ISO-8859-1" to "UTF-8":

recode ISO-8859-1..UTF-8 textfile.txt

On modern Linux-systems, the default-encoding is usually "UTF-8". It can handle characters such as German vowels easily.


20. ln: Symbolic Links

Besides files and directories, there can be socalled "symbolic links" in the directories of a Linux file system. Symbolic links are small files that point to other files or directories. Accessing the links is then redirected to the target-files and -directories.
If for example there is a file "test.txt" in the directory "/home/username", which was created with

echo "Hello" > /home/username/test.txt

then a link called "linktotest" can be created with:

ln -s /home/username/test.txt /home/username/linktotest

Afterwards, the content of "test.txt" can be copied to a file "test2.txt" using the link:

cp -v /home/username/linktotest /home/username/test2.txt

So "test.txt" was then accessed using the symbolic link "linktotest".

Note: When I delete the symbolic link "linktotest" on my system with "rm -v /home/username/linktotest", the target file "test.txt" isn't affected.


21. date, cal: Showing Date and Time

The command "date" shows the date and time. Of course, there's also a clock in the task-bar. The system clock is updated by services via internet.

The command "cal" shows a "graphical" calendar on the console. "cal -3" expands the calendar to the three months nearby. The command can also show the calendar of other years (or this year), then printing the calendar for all 12 months. So be careful not to just write "cal 3", as that would be the calendar of the year 3, more than 2.000 years ago.


22. find, locate, updatedb: Finding Files or Directories

As mentioned above, to find a file in his home-directory, a user would change to "/home/username" with the command "cd ~". Then he would run the command:

find | grep -i partoffilename

Where "partoffilename" is a part of the name of the file, the user is looking for (the full name of the file is of course also possible).

There are many options to the "find"-command. Called without options, "find" prints the names of all files and directories, in and below the current working directory (that is the one, in which "find" has been called). Using options, "find" can do different things, it can for example only list files that are newer than a given date and so on. I'm not going into the details of these options here.

If "root" searches for a file in the whole directory tree (the file is probably a system-file then), he has another option. All files can be written into a database, which is kept by the system. This can be done by root with the command

updatedb

After this command has finished writing the data about the files and directories into the database, it is possible to find a file or directory with:

locate partoffilename


23. mount, umount: Mounting Devices

Today, most devices like for example USB-sticks are mounted automatically, when connecting them to the computer. That is, a directory is created for them in the directory tree, and their contents can then be accessed there.
On my OpenSuSE 15.6-system, these directories are dynamically created and removed by the system below the directory "/var/run/media/username".

In some cases it may be useful to know, how to mount and unmount devices by hand.
Running the command "mount" without options shows the mounted devices. There's another command "lsusb", which gives information about the mounted USB-devices.
The command to unmount devices is called "umount". Notice, there is no "n": It's "umount".
When there isn't any read/write-activity regarding the devices any more, it's also possible to use "umount" on the directories below "/var/run/media/username".

In some cases, it may be of use to mount devices manually. This is typically done as "root". The "mount"-command then needs the information about the device: Its file system, its device-node (which is located somewhere in the directory "/dev") and the directory, where to mount its contents.
USB-sticks up to 32GB memory often use the old Windows files-system called "FAT32". This is supported by "mount" using the option "-t vfat".
The option for Linux-partitions (on external devices to be mounted) is often "-t ext3" or "-t ext4".
Often, it's possible to mount ".iso"-files for example, and examine and copy their contents from the directory, where they were mounted. The mount-command to do that would be:

mount -t iso9660 -o loop,ro imagefile.iso imagedir

In the earlier Linux-days, when mounting devices by hand was more common, the information about the devices was written into a system-wide file called

/etc/fstab

That way, writing the mount-command on the console became much easier, as the device-information was read from that file. The file still exists on today's Linux-system, and it's also still possible to store device information there. It seems, if devices are listed there, the system feature to automatically mount and umount them, is deactivated.
The lines in the file "/etc/fstab" have a certain format, but I don't have to describe it here, because the information can easily be found on the internet elsewhere.


24. rpm: Managing Software Packages on a rpm-Based Distribution

On OpenSuSE Leap (up to version 15.6), software packages can be managed with the distribution's system tool YaST2. There's also the high-level software managing tool called "zypper" on the console.

"apt" is the main software installation tool on Ubuntu. It's designed to manage "dpkg"-packages. There are also the graphical tools "Synaptic" and "Ubuntu Software Center", but it seems on Ubuntu it's still common to use "apt" on the console.

Unlike Ubuntu, OpenSuSE uses software packages in "rpm"-format. The traditional tool to manage these packages (being root) is called "rpm". Here are some useful rpm-commands:

Software packages often depend on other software packages being installed. In general, all dependencies should be resolved, that is, a package should only be installed, if the packages, it depends on, have already been installed. YaST2 can take care of that. But if you want to install a rpm-package in a directory anyway, you can use the command (as root) "rpm -i [package.rpm] --nodeps --force".
"--force" can also be applied with "rpm -e", if the system wants to prevent you from deinstalling a package.

With the Midnight Commander (mc), it's possible to browse rpm-files, and to extract single files from them. The following command copies all files of a rpm to the current directory:

rpm2cpio package.rpm | cpio -i --make-directories


25. X-Server. Tools xrandr, xwininfo, xfontsel, xev, xmodmap, xkill, xkbset

On Linux, the window manager of desktop environments is not the only program that creates the graphical desktop. Instead, the window manager is a client to another program called the X-server. Most Linux systems use a X-server called "X.Org". And there's a protocol called "X11". Some systems use a newer protocol called "Wayland" instead, but up to now it couldn't fully replace "X11".

The main configuration-file of the X-Server used to be "/etc/X11/xorg.conf". Now, the contents of this file are spread into several files in the directory

/etc/X11/xorg.conf.d

So, in this directory configuration files for the graphics card, the monitor and the keyboard can be found. The graphical tools of the distribution to configure these devices may make changes to these files. The user probably shouldn't interfere by hand.

There are a number of small and old, but capable tools, which give access to certain functions of the X-server:


26. Login-Manager

Before entering the graphical desktop, there's a login-screen. It is created by a special program called "display manager". The desktop environments usually come with their own program of that type. There are for example "KDM" (KDE), "GDM" (Gnome), "LightDM" (Xfce) and "SDDM" (LXQt).

The feature to automatically login a user without entering the password (autologin) is often related to the display manager. I don't explain here, how this feature is activated, the information depends on the used display manager. In general, it's better for security reasons not to use autologin, but to always enter user name and password.


27. Autostarting Programs Together with the Graphical Desktop

Programs can be started automatically together with the graphical desktop. To do that, a socalled ".desktop"-file has to be created in a special directory, which is:

/home/username/.config/autostart

The content of a ".desktop"-file has a certain format. Take a look at other ".desktop"-files to find out, how they are written.

A system-wide autostart-directory might be (on Xfce-systems):

/etc/xdg/autostart


28. Playing and Editing Videos

For playing videos, the large, well-known, commercial internet platforms just use the webbrowser and provide their own video player.

For playing videos outside the webbrowser, "VLC player" is popular on Linux.
I'm using a different program called "MPlayer" though. There are a lot of options to the "mplayer"-command. Here are just a few:

While playing, "MPlayer" can be controlled with keys:

"ffmpeg" is a powerful console tool to recode media files (which is the basis of cutting videos for example). "mencoder" does a similar thing, but today, "ffmpeg" is often the better choice.

"Kdenlive" is a larger graphical application for editing videos.

"OBS Studio" is a larger graphical application for recording videos and performing live-streams. As far as I know, it can also combine images of the user's desktop with the webcam-recording of the user himself (which would be nice, if someone wanted to create a Youtube-tutorial about how to use Linux for example).


29. Midnight Commander

The "Midnight Commander" (shell-command "mc") is a graphical file-manager, running on the console. It looks similar to the ancient "Norton Commander" for DOS, so by today's standard it may look a bit ugly. Nevertheless, it's quite powerful.
Two directories are shown in two (sub-)windows at once, which makes managing files fast and convenient.

Two things first:

  1. "Midnight Commander" should be opened with "mc -b", so that the colours are "white on black", instead of the blue blackground, which is the default otherwise.
    To use Midnight Commander, of course the font size of the terminal has to be set to a decent value, so that the names of the files and directories can be read easily (see above about configuring the terminal program).

  2. To be able to navigate the directories properly, the option "Lynx-like motions" should be activated in the F9-menu of Midnight Commander, at "Options / Panel Options / Navigation". Then, the cursor key "Right" can be used to enter a directory, and "Left" to move to the parent directory. That's quite essential for using the program.

Here are some often used key combinations in Midnight Commander:

Midnight Commander can be used to browse archive files like ".zip"-files, ".tar.gz"-files and so on. Also ".rpm"-files are supported. If the cursor is on the archive-file (whose file-permissions have to be set to "not executable"), the Return-key can be pressed to move inside the archive. There, the usual keys like F5 and so on can be used, as if the location was just another directory in the directory tree (at least that's the idea).


30. lpq, lprm, xsane: Managing Printers. Scanning

Printing on paper and printers themselves have become less relevant in recent years, as communication is moving more and more towards email and web formulars.
For installing and managing printers, there should be graphical tools in the distribution.
On the console, there are two traditional tools that can still be useful sometimes:

(There's also "lp", which sends raw data to a printer, but that can be considered obsolete today, as to print something, an application like "LibreOffice Writer" would be used.)

On many Linux system, a printer daemon called "CUPS" ("Common Unix Printing System") is running in the background. It also acts as a local webserver, so clients can connect to it to configure printers. CUPS can be accessed by pointing a web-browser like Firefox to the address "http://localhost:631" (that is to here). It should be possible to configure some printer settings there. But as said, the distribution may have other graphical tools to do that, too.

Printing to paper may have become less relevant, but scanning paper documents still is. On Linux, there's an application called "xsane", which basically takes care of every aspect of this process.


31. cron-Daemon, at: Run Programs at Other Times

On Linux-systems, a service called the "cron daemon" is running in the background that can start programs on its own at predefined times.
The cron daemon checks the following directories for programs to run in the specified intervals:

/etc/cron.hourly/
/etc/cron.daily/
/etc/cron.weekly/
/etc/cron.monthly/

If the cron daemon should do something at another time or in another interval, there's a file called

/etc/crontab

in which these tasks can be configured. Lines in that file have to be in a certain format. I don't explain that format here, the information can be found on the internet.


Another way to run programs at other times is the command "at" in combination with the daemon "atd". If the daemon is running, the commands "atq" and "atrm" can be used to control the task-queue. Here are examples, how to declare tasks:

at 15:20 -f /home/username/someprogram

at now + 15 min -f /home/username/someprogram

There may be problems, when trying to start graphical programs with "at", as it may not be able to access the user's graphical desktop. So it may take some effort to setup "at" properly.


32. lsmod, modprobe, rmmod: Managing Kernel Modules

There are some special files called "modules" that can add certain functionality to the kernel. These are mostly drivers for hardware devices. The modules can somehow be attached to the kernel or removed from it. They are usually managed being "root".
The command "lsmod" shows the modules that are currently attached to the kernel.
"modprobe [modulname]" probes, if the given module is currently attached to the kernel, and if it is not, it is attached to it.
"rmmod [modulname]" removes the given module from the kernel. As a result, some functionality of the kernel may not work any more.


33. Making Changes to the Configuration of the Bootloader GRUB2

Bootloaders (also called "boot managers") are the programs that control the boot-process of the operating system.

From a running Linux, changes to the configuration of GRUB2 can be made, which take effect at the next boot-time. But of course, making these kind of changes has its risks, as the system may not boot anymore, if done incorrectly. On OpenSuSE Leap 15.6 for example, there's a template-file called

/etc/default/grub

where these kind of changes could me made (being root, of course). Before changing this file, in any case a backup of it should be made.
In the file, there are lines with options for GRUB2.
Lines starting with "#" are just comments, which are ignored.
On my system, the most important line in the file looks like this:

GRUB_CMDLINE_LINUX_DEFAULT="splash=silent quiet security=apparmor mitigations=auto"

These are the kernel-options. The line has to be exactly in this format. That is especially, there mustn't be space characters around the equal-signs ("=").

On some systems, there may also be a kernel-option "preempt=full". What these kernel-options do, and what options would be best for the system, should be investigated, before making any changes.

When all changes are done, the settings can be written from the template-file into the bootloader-configuration with the command (run as root):

update-bootloader

(On older distributions, the corresponding command used to be "grub2-mkconfig -o /boot/grub2/grub.cfg".)

So the real configuration-file of GRUB2 is "/boot/grub2/grub.cfg". But this file shouldn't be edited directly. Instead changes should be made only as described above, that is by editing the template-file "/etc/default/grub", and then running the command "update-bootloader".


34. Customizing the Linux Installation

Linux distributions can be customized to the taste of the user. They come with graphical tools to change settings for example of the look and feel of the windows. In the desktop environment Xfce4, these graphical tools can be found in "xfce4-settings-manager".

There were a number of more complex things, I changed for me in my OpenSuSE-distributions. So I took notes of these changes, that is, I wrote other web-pages about customizing the system to my personal needs. There are:

Of course, to make changes to a system, some basic knowledge about how it works in general is required. I hope the page "Using Linux" could provide this information.


35. bash, Perl, Python, C, C++: Finding Your Way into Programming (If you want)

Here's a quick overview over several programming languages, whose programming tools (interpreters, compilers) can be found on Linux systems. I've written other pages about those languages, so I'm also putting down the links to those pages:


36. Legal Topics: The Principles of "Free Software". The GNU General Public License (GPL)

So what is this Linux anyway, and why can it (usually) be downloaded and used for free?
Well, Linux is "free software", and therefore takes a rather different approach to distributing the software to users than proprietary software. And that happened like this:

Once upon a time, in the 1970s, a computer-scientist named Richard Stallman worked in a computer laboratory somewhere in the USA. As computing power was very limited back then, several people had to work on a single machine. Each person had his or her own workspace and his or her own keyboard (called "terminal"), but all keyboards were attached to one computer. These people shared the software on that computer, and everybody could read its source-code and change it, if he or she wanted to.
Then, one day, the laboratory bought a program from an external commercial software-company. It was closed source-software. So the people at the laboratory (the user) couldn't read its sources or change the program. More and more companies produced proprietary software, and more and more programs of this kind were bought.
Richard Stallman was annoyed by that. He wanted software to be like it had been before for him. He wanted software, whose sources could be read and changed by everyone. So he became an activist and founded the "Free Software Foundation". The foundation said: "Commercial companies may produce proprietary software, but we produce our own kind of software, free software."

In the English language, the word "free" has two meanings: Either as in "free beer" (you don't have to pay for it) or as in "freedom". "Free software" means "free as in freedom" - so it doesn't necessarily mean, you don't have to pay for it: Maybe you have.

So, the Free Software Foundation wanted to defend and promote the rights of the user. They demanded, that free software should give four freedoms to the user: The user should have the right to:

Proprietary software can control the computing of the user. Free software enables the user, to control his own computing.

The Free Software Foundation developed a license for that kind of software, which guaranteed the user these four freedoms (or rights). It is called the "GNU General Public License" (GPL).

Notice, that this license also grants the user the right to sell copies of the program (as part of the right to distribute it). That means, although today most free software is available somewhere on the internet legally without any charge, someone else may try to sell you the same software for a charge, be it in a store or on the internet. He is allowed to do that, and if you buy the software from him, you'll have to pay for it.

Then, the Free Software Foundation launched the GNU Project to develop free software. Many command-line programs for an operating system were written, but also programs like "GNU Chess". Richard Stallman wrote the powerful editor "GNU Emacs".

The GNU Project wanted to develop a whole free operating system. But the GNU kernel was not yet finished, when in 1991 Linus Torvalds started a project to develop his own kernel called "Linux".
Many developer joined Linus Torvalds using the internet, that just started back then.

The kernel "Linux" finally became usable, and the system-utilities of the GNU Project were added. So, a free Unix-like operating system for Intel-processors was created. Its name should be GNU/Linux, but as just "Linux" is shorter, most people call it just that. The Linux-kernel also uses the "GNU General Public License" (GPL, version 2).

So the way of developing new software is rather different:

The internet increased the development of more complex programs of free software drastically. "Linux is a child of the internet."

The principles above also mean, that the developer of proprietary software has a strong interest in market share. He wants to sell as many copies as possible, as that's how he earns money.
To free software or its developers on the other hand, market share is totally irrelevant. Also, the user, who downloads free software (especially without charge) isn't a customer of anybody. "The Customer is King" - that may apply to someone, who has bought proprietary software. But not to someone, who downloaded free software. If he doesn't like it, if the software doesn't do, what he expects from it, if he won't download it again: The free software simply doesn't care.
Free software doesn't have to look good or be modern either. It doesn't have to survive on the market. There is no market for it. If a free program is that bad, that it doesn't have a single user, it still doesn't care.
Now you should be able to understand, why many free programs for Linux may seem kind of unfinished, unpolished, old-fashioned or experimental, and that that's a result of the underlying principles of their development, which are rather different from the common principles of capitalism.

When a software is free, it doesn't necessarily mean, that it's technically better. Maybe the proprietary software does the job better. But still the issue remains, that proprietary software can make you, the user, lose control over your own computing, and - for example - spy on you.
Or like Linus Torvalds put it: "Software is like sex: It's better when it's free."

In this interview Richard Stallman explains in detail, what Free Software is about.

In another lecture at the University von Calgary (2009-02-03) Stallman also explains, that the postulation of the "Four Freedoms" can only relate to software, because these freedoms depend on its very nature. Only when dealing with compiled software, there is an executable program and a source code that belongs to it, which may be held back or changed. Only software and other digital data can be copied countlessly and can be distributed quickly and easily.
That's not the case with the things of everyday life like a table or a chair, for example. A table itself doesn't have a source code, and it can't be copied easily millions of times. There may be a technical manual, how to produce the table, but that would be something else than the table itself.
So the imbalance in the relation between the producer and the user of a program, and the claim of the "Four Freedoms" of the user is a problem, that only occurs with computer software and hasn't caught the attention it deserves yet. But the more the digitalization of the world progresses, the more important these questions become.

A Bit of History about Unix and Linux

At the beginning of the 1970s, in the very early days of computing, scientists needed a professional operating system for their large machines too. So an operating system called "Unix" was developed by AT&T Bell Laboratories, by people like Ken Thompson, Dennis Ritchie and Brian Kernighan. The first version of Unix was released in 1973. To be able to write commands for Unix, Dennis Ritchie created the programming language C.

In 1991, Linus Torvalds was a student of computer science at the university of Helsinki. As a teenager in the 1980s, he had the home-computers Commodore VIC-20 and Sinclair QL. There wasn't much software for these kind of exotic and limited machines, so unlike most other teenagers he didn't spend his time playing games, but learnt how to program these computers on a fundamental level, so that he could write his own programs. As a student, he bought a PC with a 386-processor. At university, there was a course about Unix, based on the book "The Design of the UNIX Operating System" (Maurice Bach, 1986).
So Linus Torvalds had the idea to write a Unix-like operating system for his 386-PC. He announced his plans in a newsgroup, got help and succeeded.
So Linux is basically a free clone of Unix. Back then, nobody thought, it would one day kind of replace the well-respected commercial Unix. Linux' mascot is a penguin called "Tux":

 

Unix had some rather advanced features and therefore was in the 1970s way ahead of its time. Especially it supported multi-tasking and the management of multiple users and user-rights. While most other operating systems of the time supported just a single task and a single user.

In Linux the support of multi-tasking means, that tasks run in separated environments. They can crash like in every other operating system, but in Linux, the rest of the system usually isn't affected by this, but stays intact. Therefore, Linux is known to be a rather stable operating system.


37. Recapitulation

So what have we learnt about Linux on this page?


38. Notable Files and Directories on a Linux System. Conclusion

Here's a list of notable files and directories on a Linux-system. The files and directories have already been mentioned in the previous sections of the website. The list is in alphabetical order:

/binA directory with executable commands. Other directories with commands are "/usr/bin", "/usr/local/bin" and "/usr/sbin" (see below).
/boot/grub2/grub.cfgThis is the real configuration-file of the bootloader GRUB2. The file should not be edited directly. Damaging this file may prevent the operating system from booting. Better leave it alone.
/etc/bash.bashrcThe system-wide configuration-file for the shell "bash".
/etc/bash.bashrc.localAnother system-wide configuration-file for bash, used to separate local entries from the main configuration-file.
/etc/cron.daily
/etc/cron.hourly

/etc/cron.monthly
/etc/cron.weekly
Executable files in this directory are executed by the cron-daemon on a daily/hourly/monthly/weekly basis.
/etc/crontabThis file can be used to program more tasks for the cron-daemon.
/etc/default/grubThe template-file that can be edited to make changes to the bootloader GRUB2.
/etc/fstabThis file used to hold the technical specifications of mountable devices, to be read by the "mount"-command.
/etc/sudoersThis file can be used to define commands that users can execute as root using the "sudo"-commmand. The special program "visudo" should be used to edit this file.
/etc/X11/xorg.conf.dIn this directory, there are configuration files for the graphics card, the keyboard and the monitor. These files shouldn't be changed by hand without reason.
/home/usernameThe home-directory, in which the user is usually working. Inside this directory, the user can create as many subdirectories as wanted.
/home/username/.bash_historyIn this file, bash keeps track of the commands, the user entered, to provide the feature of cycling through previously entered commands with the cursor keys on the command-line.
/home/username/.bashrcThe user's configuration-file for the shell "bash".
/home/username/.configIn this directory, many applications store their configuration files.
/home/username/.config/autostartPrograms, that have a corresponding ".desktop"-file in this directory, are executed automatically right after the start of the graphical desktop.
/rootThis is the home-directory of "root", the system-administrator.
/usr/binThe default-directory of the system-commands.
/usr/local/binAnother important directory with commands. As it is listed in the $PATH-variable, executable files that are copied here, can be executed from anywhere in the system.
/usr/local/shareSimilar to "/usr/share".
/usr/sbinA directory with system-commands only to be used by root.
/usr/shareIn this directory, applications store their program data, like for example the image-files of their window-icons.
/var/run/media/usernameOn my distribution OpenSuSE Leap 15.6, inside this directory, the directories of automatically mounted external devices such as USB-sticks can be found.

Well, that should be enough information to get you started with Linux, if you wanted to.
 


Creative Commons License
This work is copyright 2026-02-22 and belongs to Hauke Lubenow.
It is licensed and may be redistributed under a Creative Commons Attribution-ShareAlike 4.0 International License (CC BY-SA 4.0).

Email: hlubenow2 {at-symbol} gmx.net
Back to the main-page