Skip to content

Instantly share code, notes, and snippets.

@rushsteve1
Last active October 18, 2020 22:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save rushsteve1/f48706bfb57984ca0104 to your computer and use it in GitHub Desktop.
Save rushsteve1/f48706bfb57984ca0104 to your computer and use it in GitHub Desktop.
Linux

Basics of Linux

This guide is designed to help new users understand the more important aspects of Linux. It is not meant to be an exhaustive tutorial, but rather a primer.


Introduction

Linux (or GNU/Linux) isn't one singular operating system as many people believe it to be, but rather a broader term for a large number of operating systems built using the Linux kernel. These different operating systems are referred to as distributions or "distros". Different Linux distributions use the same mostly the same software but are packaged and setup differently. Many, if not most, distros are based of off other more popular distros. The major differences that the average user notices are in what desktop environment the distro uses, and how/where software is managed and installed from.

Linux is built upon the ideas of Free Software. This doesn't mean only free in price, but also free as in "freedom". Free and Open Source software is software that's code is available to view and be contributed to by the public as well as redistributed. This means that bugs and security issues can quickly be found and fixed, as well as making sure that the software respects user's privacy. The ideas of Free Software also mean that you are allowed to modify each and every part of your system to your liking.


Installation

Very few computers come pre-installed with a Linux distribution so it is necessary to install it yourself. First your must decide which distribution (and usually which desktop environment) you wish to install and download the .ISO file from its website.

Create Install Media

Once you have downloaded the .ISO file you must create your installation media. This is either a CD/DVD disk or a USB. Depending on what distro you choose there are different size requirements for the install media, but usually they need to be 2GB or bigger.

CD/DVD

.ISO files are designed to be burned to CD/DVDs so it is usually a simple matter of double-clicking the file to open the default disk-burning utility.

USB

.ISO files are not designed to be put on USB drives, so you need a utility like UNetbootin to do it. By following the instructions within the application you should be able to easily make an install USB.

Install to Computer

Insert your install media into the computer that you wish to install Linux on. Now you have to get to the boot devices menu. This can usually be brought up by pressing one of the F# keys at the top of the keyboard, or the DEL key. You are NOT trying to open the BIOS menu.

Once you open the boot devices menu select your install media. From there 90% of distributions will have a graphical installer that will guide you through the installation. Be careful not to wipe your entire partition if you do not want to lose whatever OS is currently installed.

If you are installing a distro that does not have a graphical installer there are plenty of other guides online but it is usually similar to Arch's Install.

Virtual Machines

If you do not want to install Linux on your computer but still want to try it you might want to create a virtual machine. You do not need to create and install media either, though you do still need the .ISO downloaded.

First you need to install a virtual machine application such as VirtualBox. In VirtualBox create a new machine, and name it what you like and select your chosen distro from the list. If it is not on the list choose "Other Linux". Next set the amount of RAM needed. After that you will be prompted to make a virtual hard disk. It is best to leave it at the default settings allowing the virtual hard disk to be dynamic and become bigger as needed.

Now that your virtual machine is created you have to set the .ISO file as a virtual CD for the machine to mount. Right-click the machine and click Settings>Storage. Select the "Empty" CD slot in the menu, then click the CD icon on the right, navigate to the .ISO you downloaded and click "Open".

After that you can close the settings menu and start up you virtual machine. From there it is the same as the Install to Computer instructions (See above) but without the need to open the boot menu.


Distros

Different distributions are managed and developed by different organizations. This means that they may include different features and software, as well as having different developers and maintainers.

The most popular distros, from which most other distros are derived, are:

Ubuntu

http://www.ubuntu.com/

Ubuntu, developed by a company named Canonical, is the most popular Linux distribution, and is based off of Debian (See below). Ubuntu uses the Unity desktop environment, also developed by Canonical, and is the only distro to do so. Due to it's immense popularity there are a variety of spin-offs, most of which are designed for different desktop environments but some are maintained almost entirely independent of Ubuntu. New versions are released every 6 months.

Debian

https://www.debian.org/

Debian is one of the oldest Linux distributions and is maintained by an organization by the same name. Supporting a variety of desktop environments Debian is well liked because of its stability, due to its slow 2 year release cycle.

Mint

https://www.linuxmint.com/

Mint is an Ubuntu derivative that is aimed toward those less technically inclined or new to Linux. Shipping with their own Cinnamon desktop environment, Mint also comes with a lot of common non-free software, such as Adobe Flash and Java, built in.

Fedora

https://www.getfedora.org/

Fedora is the free variant of the enterprise Linux distribution RedHat, and is maintained by RedHat, and is similarly tailored for the corporate workstation. Fedora and RedHat are a major contributor to the GNOME desktop and come pre-configured to use it. With it's corporate backing Fedora is a solid and stable distro, good for both new and experienced users.

OpenSUSE

https://www.opensuse.org/

OpenSUSE is similar to Fedora, it is based of off another enterprise Linux named SUSE. However while Fedora and RedHat support the GNOME desktop environment, OpenSUSE and SUSE support KDE. Unlike most Linux distributions where many advanced system configurations are within configuration files, openSUSE comes with the Yast configuration manager. A good distro for those who need a more Windows-esque experience.

Arch

https://www.archlinux.org/

Arch is an extremely minimal distribution, without a graphical installer or desktop environment pre-installed. Famous for its continuous rolling release system, Arch is not for those who want their system to work right out of the box. Arch is designed for those who truly want to understand how their system works and have full control over it.


Desktop Environments

A Desktop Environment is the main graphical interface that a user interacts with. This includes things such as the application menu, task bar, and even various animations among other things. The desktop environment is also responsible for managing the application windows and creating virtual desktops as well as providing them with the various toolkit that they may require, typically either GTK or QT.

These toolkits are extremely important as they are what is used by most applications to display their interfaces. While you can use either toolkit in any desktop environment they do specifically support one toolkit or the other thus allowing for better performance and use of the applications using that toolkit.

The most popular popular desktop environments are:

GNOME

https://www.gnome.org/

The GNOME desktop environment was the most popular desktop environment and its application toolkit GTK is widely used. However with the advent of GNOME 3 it has lost a large degree of its popularity, due to it's emphasis on minimalism and atypical usage.

By default GNOME has no taskbar nor the ability to minimize windows. Instead it dynamically creates virtual desktops to keep windows, and has a full screen window switcher and application launcher.

The fullscreen GNOME application menu

GNOME's Window List

MATE

http://mate-desktop.org/

After the controversial release of GNOME 3 many users desired the traditional look and feel of GNOME 2. MATE is a continuation of GNOME 2 designed to support modern technologies while still maintaining same usage. MATE is one of the youngest major desktop environments, though as a fork of GNOME 2 is well tested.

MATE has a taskbar at the bottom of the screen and a statusbar with application menu at the top.

MATE Desktop

KDE

https://www.kde.org/

KDE is traditionally the major rival of GNOME. Built on the QT framework it is actually the development of KDE the prompted the creation of GNOME. KDE is a comparatively resource heavy desktop environment, however it is feature packed and has great applications. KDE 5 is the latest version, though KDE 4 is still supported and popular.

KDE is a "traditional" desktop with a bottom taskbar with applications menu though it also has a robust widget system. It is highly customizable though so can look many different ways. It also features a powerful "Activities" system allowing for different desktop configurations for different purposes.

The KDE 5 desktop

XFCE

http://www.xfce.org/

XFCE is a lightweight and flexible desktop environment. Built modularly XFCE is highly customizable, which is the source of its popularity. Built on the GTK framework XFCE works with nearly all GNOME apps. However XFCE's development is slow with months to years between releases.

XFCE, like KDE, is a more traditional desktop by default but is even more customizable.

The XFCE desktop

Cinnamon

http://cinnamon.linuxmint.com/

The Cinnamon desktop environment was created specifically for the Linux Mint distro. A more minimal take at the traditional desktop Cinnamon is built on GTK and is very user friendly. Many consider it to be a direct competitor to MATE as the "New GNOME 2".

While less featureful KDE and less customizable than XFCE it is still popular among many people seeking the traditional desktop especially those .

The Cinnamon desktop

Unity

http://unity.ubuntu.com/

Created entirely for Ubuntu, Unity is only found on Ubuntu. While it is disliked by some, it is notable as the default desktop environment of the most popular distro. Built directly off of GNOME, Unity uses GTK. However in the upcoming Unity 8 they are switching to QT.

Featuring a vertical taskbar, a top statusbar, and a fullscreen/partial-screen applications menu. Unity shares many similarities with GNOME.

The Unity desktop with the applications menu open.

LXDE/LXQT

LXDE is an extremely lightweight desktop environment designed for low power machines. In order to stay lightweight it does not have a default toolkit. However LXDE is being transformed into LXQT and is going to be built upon the QT framework.

LXDE is extremely lightweight and modular similar to XFCE. It's default setup is traditional, but can be customized for performance/preference.

The LXDE desktop

The LXQT desktop

Other

There are many other desktop environments not listed. For a more complete list try: https://en.wikipedia.org/wiki/Desktop_environment

It is even possible to create something of your own off of a standalone window manager and whatever applications you choose.


Installing Software

On Linux software is composed in what are called "packages". An application can be composed of multiple packages. Because of the package system applications are rarely installed right off the internet, but rather through a "Package manager" from a central repository maintained by the developers of the distro.

Package managers allow you to search and find the applications you want to install and uninstall and since the packages are maintained by the distro they are never malware or viruses.

In addition when an application is installed it frequently needs other software components to function. This is called a "dependency". On a system like Windows these components would have to be installed via the application installer. However on a Linux system instead of installing the dependencies with each application that needs them, they are just another package that the package manager installs with it. When multiple programs have the same dependency it only ever has to install it the first time then each other time refers back to the package it already installed.

The package system also means that updates made to any applications can be easily made by upgrading their individual package. This makes keeping software up-to-date extremely easy. However distros handle how they do package updates slightly differently. Most distros have release cycles where they update all their packages all at once in releases, with only important updates in-between. This tends to be more stable, though you get updates slower. The other way that distros handle is a rolling release, where packages are updated continually as the releases are made by developers.


The Terminal

Many users fear the terminal as something only hackers use, and never realize its true power. A Linux terminal can do just about anything a desktop environment or other graphical application can do, and then some. Many online help and tutorials will exclusively use terminal commands because they are consistent across desktop environments and distros.

Things to know

Filesystem

A terminal is always working in a folder or "directory". By default the terminal is at the Home directory, which is the folder for your user.

Linux's filesystem is arranged around the Root. The Root, frequently denoted with the forward-slash ( "/" ), is main drive of the computer. All other folders, files, and even drives are within the Root. When typing a path if you type "path/to/file" it will look for that file in whatever folder you are currently in. However it you type "/path/to/file" with the slash in front it will look for the file under the Root.

Structure of Commands

Commands can sometime take two different things: options and arguments. and argument is something that the command needs to know. This can be a path, number, etc. An option is always marked with a "-" followed by a letter. If multiple options are used they all follow the first "-".

I will be marking arguments in races with the type of argument inside, and options in brackets with an explanation below.

Commands

There are thousands of commands to do every task imaginable, but here are the most important commands with their most used options:

man [-k] {name of command/keyword}

Manual of given command. If the "-k" option is used it searches manual pages for the keyword.

cd {path}

Change Directory to the given path.

ls [-a]

Lists all files and folders in current directory. The "-a" option lists hidden files as well.

pwd

Print Working Directory. Tells you what directory you are in.

cp {path to source} {path to target}

Copies the source file to the target location.

mv {path to source} {path to target}

Moves the source file to the target location. Can be used to rename files by putting the new name as the target.

rm [-r,f] {path to file}

Deletes file at given path. The "-r" option removes deletes all files and folders within given directory (if directory is given). The "-f" will make rm not prompt you when deleting files, and is usually used with "-r" so that it does not prompt you repeatedly.

nano {path to file}

A simple in-terminal file editor. If file at path given does not exist it creates it. Note: If a tutorial online ever uses vi/vim/ed/pico in a command, replace it with nano. Those are other editors, which while great, are harder to use.

mkdir {name}

Makes a directory with the name specified.

rmdir {name}

Removes a directory with the name specified.

cat {path to file}

Returns the contents of a file.

chmod [+x]

Changes the permissions of a file. The "+x" option is not preceded by a dash and is used to allow a file to be executable.


##Getting Help Problems can come up on even the stablest and most well maintained systems. The best resources are:

  • Google. Simply searching your problem can often lead to a solution.
  • The Arch Wiki is the de facto Linux wiki.
  • Reddit /r/linux4noobs or /r/linuxquestions
  • IRC. Many distros and desktop environments have their own IRC channels.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment