
It so happens that even at Habré many people have a very vague idea about the Linux OS family.
The purpose of this article is to tell the most popular language about the features and differences between Linux and Windows for those who have never had a job with it.
')
I have been using Archlinux for several years, downloading Windows only “to play with”. This article talks about things that I learned empirically, poking like a blind kitten. If at one time I would get exactly such information in this form - it would save me at least 2 years, during which I switched from Windows to Linux.Almost a quote from
Lurkmor :
The basic principle of working with linux-systems is “From understanding-to action”, while in Windows- “I know where to click / where to put a check mark - I do”. In other words, to do something - you need to understand how it is there, inside, is arranged.Thesis number 1 - MUST own work with the system from the text console!
“Clean” Linux (basic system) in any distribution looks like DOS - black screen, text mode, the blinking cursor is waiting for input. When you come across such a person for the first time, you sit and think: “Damn, what is there to write?”.
Modern user-friendly distributions give the illusion that the user does not need a console. Good uncles, they say, have already taken care of everything. Here's a wallpaper for you in FullHD resolution, here is a program for setting parameters - know the checkboxes, everything is like in Windows ... To avoid unnecessary holivars, I will make a retreat at this place.
There are Linux users who never have anything buggy. Ubuntu is upgraded from one major version to another, and since Ubuntu 1.0, and so on. Guys, do not write anything in the comments about the uselessness of the console for the user, go rather and admire the rainbow that pink ponies poop in your world.
In my world, Linux is buggy and broken. No, everything is quite ok if you just run the programs and use them. But then suddenly a moment comes when you need to, say, change the open firewood to proprietary ... well, or just update the system. And here, if the stars got up badly, you get a broken system and a text console as the only way to interact with it. And (what is the worst) - such garbage tends to happen
regularly .
My experience suggests that at such times, the Windows user acts as he is accustomed to, obeying the usual ideology. At first there is an attempt to “fix”. Windows-ideology prescribes to find in the internet a discussion of a similar problem and its solution, and then
repeat all the actions that led to the solution of the problem . The result - the user thoughtlessly drives in incomprehensible commands. Sometimes it even helps, more often - no: the contents of the commands must be modified for specific conditions and a specific local machine, but there is no knowledge for that. As a consequence, the next logical step is to reinstall the system. Believe me, I know what I'm talking about - I broke and reinstalled Ubuntu more than 10 times ... of which about a third after the spontaneous death of the system during the update process, without correlating with the curvature of the hands.
Studying the device of the system and working with it from the console is akin to the well-known “losing a day - one hour to fly”. Solving the problem in this case is much faster than reinstalling, not to mention the fact that it becomes much easier “not to break” :) In addition, the difference completely disappears - you sit at the computer locally or through a remote SSH session. Believe me, this feeling is worth a lot.
Thesis number 2: user-friendly distributions to study the system are bad.
The developers of such distributions diligently create an interface graphic layer, designed to reduce the interaction of the user and the system to a thoughtless mouse click. Technically, this layer can be a completely enchanting pile of crutches - on bash, python, perl ... a perfect hell for a beginner trying to understand the logic of the system. In addition, the imputed documentation (if it exists at all) is lost among the forum posts of the form “to get A, enter in console B, and in the settings press the button C”
Technically minimalist distributions with high-quality and detailed documentation are best suited for training. Such, for example, are Gentoo and Archlinux. Personally, I recommend the latter - simply because in my case it worked. After a couple of years of hardships with Ubuntu, only a couple of months with Arch led me to comprehend Linux 10 times further.
There are several reasons for this:
- The technical minimalism of the system greatly facilitates its understanding.
- High-quality, detailed documentation facilitates the learning process.
- Getting out of the “comfort zone” is very helpful!
The last point is worth special mention. Ubuntu with its graphical interface does not add any motivation to poking around in the console. Another thing is when initially there is only a console and the strongest motivation to “set up this graphical interface already” - then there is no place to go, you have to master the documentation and acquire knowledge.
Windows and Linux: fundamental differences
1. File system
- On Linux, logical disk volumes are not assigned letters. Instead, one of them is assigned to the root, and the rest are connected to the specified folders inside it. All paths start with a slash, without any C drives:
- All system files are dumped in the root file system, and are divided into directories by type / purpose. Relatively speaking, all the settings are in / etc, the executable files in / bin and / usr / bin - and to all this good the ordinary user (not the administrator) has only read / execute access, and not always (when it comes to system services )
- File extensions in linux are completely optional. Whether a file is executable is determined by a special mark - by the type of the “hidden” or “archive” mark in Windows. Executable files without linux extensions are the norm of things!
- In linux there is no special mark that the file is hidden. Instead, names with a dot at the beginning are used, and file managers allow you to turn off the display of such files. That is, the /home/user/.bashrc file is hidden. The point in this case is part of the file name!
- A regular user has full access only to his personal folder, which is usually located in / home /% username%. By analogy with the D: drive: in Windows, a separate disk partition is often connected to the / home folder. Thus, all user data is located on a separate partition (or a physical hard disk in general).
- All user (non-system) programs, if necessary, to save some of their data or settings, do it only in the home folder of the user from which they are running - simply because they have the right to write only in it.
- The very concept of “file” in Linux is slightly different, wider. There is a so-called “Device files”. For example, / dev / sda is usually a hard disk (although it may be a flash drive), and / dev / sda1 is the first partition of this hard disk. From here, such tricky maneuvers as dd if = / dev / sda1 of = / home / user / backup are possible - the command will copy the entire first partition of the / dev / sda disk to the backup file in the user's home directory, one by one. There is a so-called “Symbolic links” - in the file manager they look like a regular file, in fact refer to another file, and do not occupy disk space. That is, there can be one executable file and a bunch of symbolic links to it in different places.
2. Package manager and the concept of "package", installing programs.- Programs are installed only from the administrator account. When installing, all files related to the program (for example, Firefox) are “smeared” across the root file system — settings common for all users will go to / etc, executable files to / usr / bin, and icons and various resources like graphics and sounds will in / usr / share / firefox. In this situation, in principle, the user cannot know where exactly what lies with him. The package manager is responsible for this. For example, the “Firefox” package includes a bunch of files. When installing a package, the package manager will decompose them in the file system, and if they are deleted, they will delete them accordingly.
- Another important function of the package manager is to satisfy package dependencies. For example, Firefox requires the libjpeg library to work. This means that when installing, the package manager automatically installs the libjpeg package, and when it is uninstalled, it will remove it if it is not required by any other package.
- In the package manager, there is usually a database with all the available packages, and it has the means of searching this database. Therefore, the installation of programs in linux is incredibly simple - the first team we are looking for for keywords on the basis of the exact name of the package, the second - set. No need to go to sites, search and download something. If I need to put skype in Arch - I type pacman -S skype and press ENTER, and after a minute I have Skype installed. I need Firefox - I write pacman -S firefox . And so on. In another distribution kit, the command and syntax will be different, you may need to specify the address of the repository - the principle itself is unchanged.
- Never, never even try to download and run something through a browser, like in Windows! Only if you fully know what you are doing - but then why are you reading all this?) Download and run the file is part of a completely alien (even hostile) ideology for Linux. Programs must be installed through the package manager. Point.
- Never use the “configure && make && make install” method to install the program. Every time this happens, a dozen innocent kittens die in a world of agonizing death. This set of commands will assemble a program from source, and then scatter its files on the file system without the knowledge of the package manager. This is a violation of the normal logic of working with the system. Do not do this))
- I will add, perhaps, here is another thing. Very often, you can see the insistent advice "not to work from under the administrator", and this is not quite the obvious reason for Windows users. The fact is that typing the command in the console conceals the danger of typos and accidental clicks. The situation is quite real when you are going to delete a folder, start writing a path to it and accidentally hit ENTER. Linux has no habit of asking, “Are you exactly such a fool? y / n ”- he just does. Therefore, under the root to recruit teams have extremely carefully. In Windows, of course, there is no such problem.
3. Graphic user environment
- The entire graphical user environment is a collection of application programs. Historically, for a Windows-user, such concepts as “Desktop”, taskbar, system tray, volume control, clock and calendar, “Start” menu, access to network settings from the tray are an integral part of Windows. In Linux, all of the above is implemented by separate programs. Moreover, for each task from the above list there is more than one program. As a volume control, I can put a volumeicon, written in C, or volwheel in python
- At the core of the graphical environment are the following programs:
- X-server, or simply “X”. A program that receives data from the user (from input devices) and basic window management, minimizing and expanding them. “Server” is called because it provides “network transparency”: for Linux, there is no difference in how a user logs on to a graphical session, locally or remotely. A kind of RDP as basic functionality, to put it simply.
- The window manager, also known as WM. Engaged in drawing elements of the window interface, plus (depending on tricked) providing a number of other functions. Some WM allow you to set the desktop background, some add the functionality of the “system menu”. Sometimes the simplest (to be) window manager, TWM, is installed with the X server. A terrible sin of God, straight from the 70s.
- The window decorator is sometimes a functional for the design of windows, the ability to change the themes of the design is put into a separate program.
- Composite manager - also happens as part of WM, or as a separate program. Its task is to shift the interface drawing to the video card. Technically, the principle is simple - each window drawn is a separate texture in the video card's memory. And to handle textures, add effects and distortions, project on a plane in space, change the translucency and overlay them on each other video cards have been able for many years.
- Interface elements: taskbar, tray, network manager, system menu, program for setting desktop wallpaper
- Basic application software - file manager, terminal emulator (to write console commands in a beautiful translucent window)
- The pre-configured “bundles” of the elements of the graphical environment selected for each other, the programs from the list above, are called “Desktop Environments”, or DE. The most famous are such DE as Gnome and KDE, the heaviest and “fatty”. There are also XFCE and LXDE. Installation is often implemented by installing a so-called meta-package - the package itself does not contain files, but as a dependency it requires installing the entire set of programs that make up DE: WM, the decorator / composite manager, the file manager, and so on
- It is also possible (and often it is reasonable) to assemble for yourself an environment of “pieces” to your liking - select WM separately, a separate file manager, and so on.
Summarizing
After a little self-education, the graphic system is received from a text-based console system into one command. In my case, I type:
pacman -S xf86-video-ati xorg-server openbox tint2 nitrogen lxterminal xcompmgr wicd-gtk volumeicon .
This is the command to install all the packages listed:
xf86-video-ati is an open-source driver for my video card.
xorg-server is “X”
openbox is a lightweight WM with a system menu (such as “Start”)
tint2 is the taskbar with the tray where applications will be minimized
nitrogen allows you to set the desktop background
lxterminal is my favorite terminal emulator
xcompmgr is the easiest composite manager, adds translucency and shadow
wicd-gtk is a network connection manager that hangs in the tray
volumeicon - volume control
After that, already from the graphical environment, through lxterminal I install everything else that is needed for life: browser (s), file manager, video and audio codecs, player, libreoffice, gimp, etc.)