Linux starter knowledge

Photo by Ian Parker on Unsplash

Photo by Ian Parker on Unsplash

Entering the world of Linux-based operating systems is quite a ride when coming from a Windows background. The highs are high, and the lows are low.

CLI first

When coming from a Windows background it's easy to think of a modern computer as a nice GUI (Graphical User Interface) based computer that doesn't need a CLI (Command Line Interface) to function. You can live an entire life only using your finger to tap at things on a touch screen or a mouse to click and interact with buttons and widgets on the screen.

With Linux, it's very obvious that in reality, everything that you can click on and see in a GUI is actually just an interface to interact with a specific way of running a CLI program.

Because most of the software running in Linux is written by programming enthusiasts in their spare time the developers usually focus most of their energy on functionality and not as much on the look and feel of their GUI applications. It's easy to forget that the visual design of an application is an entire profession and that most programmers are not designers. This makes many GUI applications have a very DIY (Do It Yourself) look and feel to them.

On the flip side, since functionality and modularity are the focus of Linux software developers I personally find it easier and in many ways a lot more intuitive to run programs in the CLI on Linux compared to Windows.

Spending a lot of time in the Linux CLI, running commands, and scripting sequences of commands in scripts can be a nice introduction to programming. Because of the open design and functionality of Linux-based operating systems, I do think using Linux it's an excellent way to learn how computers actually work aka computer science. This insight is transferable to any computer system, including Windows.

The learning curve might be steep in the beginning, but with Linux, you can learn and practice how to completely modify how the computer works. You can make it completely yours without any restrictions. This is why I think Linux is so loved by computer enthusiasts and hackers.

Users

Users are not just for humans

When I first learned about basic Linux security I was very confused about the fact that there were so many users on the computer.

In Linux-based operating systems, it's very visible that there are users on the system that is used by processes (running programs) on the system. You might have a user named apache, and a user named docker. To an untrained eye, these are listed similarly and appear to be of equal use as user accounts for human users.

In my first months of using Linux, I read an article about the security risk and the importance of deleting unused users and users groups on the system. I took this to heart and deleted every user on the system except the root user and my own user. By doing this I accidentally deleted process users. As a result, I got a completely broken OS and had to reinstall it.

Users are a security feature that is used to limit what a process can do on the system, similarly to how a user account belonging to a human is limited. This is normal for all operating systems, but on Windows, a process and the system user account is a bit more hidden.

Packet managers

Don't delete dependencies!

Linux is Unix bases. Many, perhaps most beginners do not know is what this actually means.

In essence, Unix-based operating systems are built using many small programs called packages. Some of these packages depend on and use other packages for functionality. since many packets depend on packages that other packets also depend on there is no need to install multiple copies of the same packet. To manage package dependencies and to prevent the installation of duplicate packages on the same system packet managers are used.

When installing a piece of software you browse the packet manager and install the application packet you want to install similarly to application stores on Android and iOS devices. During the installation process, the packet manager looks at the packet dependencies the packet has and installs the dependencies that are not installed on the system along with the packet you want to install.

If you have installed 4 out of 7 packages the packet depends on, the packet manager only installs the 3 you have not installed. This is great, and really an amazing way to manage software on a computer.

The problem comes if you do not fully understand this concept, and want to delete a packet. If you delete all the packages this packet depends on you might end up breaking another packet that now misses packets it also depended on.

With Ubuntu and other Debian-based distributions, it's very risky to run "apt autoremove", because this might delete packages that others depend on.

The takeaway is that you should be very careful when deleting packages. Only remove dependencies that no other package depends on. Thankfully most packages are very small and take up very little disk space.

Distributions

Linux is not Linux

It's actually very inaccurate to call Linux-based Operating systems, Linux. Linux is only the kernel part of the operating system that acts as a middle layer between the computer hardware and the software.

A more accurate naming is GNU/Linux because most of the basic operating system software packages like the Bash shell and packages that make it possible to navigate filesystems come from the GNU project.

The GNU/Linux combo is what acts as the fundamentals for every Linux-based distribution like Ubuntu and RedHat.

What separates Linux distributions is in many cases what type of packet manager is used, and what packages come preinstalled on the system.

Versions of the same distribution can vary a lot on what packages are used for various basic OS functionality like network management and background system process management. Since the selection of those basic and important packages can vary from distribution to distribution and from one version of a distribution to another it can very important to follow tutorials and guides that are aimed at the same distribution and distribution version that you are using.

It's natural to think that a newer version of a Linux-based distribution is just an evolution of the operating system. So a configuration works on Ubuntu 16 it should also work on Ubuntu 20, just like with most other software. This is not the case with Linux distributions.

If you follow a configuration guide for Ubuntu 16, on a Ubuntu 20 system you might actually break something. Be careful!