BackReturn Home


An Introduction To Using Linux

These notes are mostly based on this video series by Eli the Computer Guy. It may contain certain "Eli-isms", as well as some of my own interpretations. Extra resources are interspersed throughout.

Contents:

General Background Information
Easy Installation
Using Basic Commands...


General Background Information

An "Operating System" (or "OS" for short) is the main piece of software on a computer. It gets all of the other software to work with the hardware of the computer. The core part of the Operating System is the "Kernel". The Kernel always stays in memory. Two popular Operating Systems are Microsoft Windows and macOS.

The GNU Operating System + The Linux Kernel = GNU+Linux [This is what most people are referring to when they just say the word "Linux".]

If you are just curious about GNU+Linux and don't know where to begin, then skip to the next section Easy Installation.



Types of GNU+Linux:

• "Forks"
Each may use a different set of commands, different package managers, and/or have a different file structure. [Example: Debian vs. Redhat]

• "Distributions" (or "Distros" for short)
Each may come bundled with a different GUI, different default settings, and/or different applications. [Example: Ubuntu vs. Fedora]

• "Versions"
Each may change through a periodic update (e.g.: security patches). This is usually designated by a version number. Note that legacy software may only run on a specific version.

As you go down the above list, it becomes more specialized, more specific.

All of this might sound complicated. It doesn't have to be! Pick a Distro that will suit your needs. Some questions to ask yourself:

• Does it need to run on a specific piece of hardware?
• Am I willing to pay to get extra tech support?
• Is everyone who is going to use it familiar with it? If not, are they willing to learn?



"Free Software" can mean either:

• You can see and modify the code of a program ("Free, as in speech")
• No purchase is necessary in order to use a program ("Free, as in beer")

Some people also use the term "Open Source", or the acronym "FOSS" (short for "Free and Open Source Software"). There can be many nuances behind the usage of these terms.

Whatever the case, there may be a specific "Terms of Service" (i.e.: rules for how we can use it). Also, look carefully at the License. [These are very important considerations when using any software, not just GNU+Linux. We need to make sure that we can do with it what we think we can do with it. Software with a particular License may require that anything built off of it must also use the same License. Further, the main piece of software may follow one License, while add-ons might follow another.]



• "Command Line Interface" (or CLI) - This is a text-based way of interacting with a computer (i.e.: you type in "commands" to get it to do things). The CLI is often just referred to as the "Shell" (because it is the software that 'surrounds' or interacts with the Kernel). The default Shell is usually a program called Bash, but there are others available too (e.g.: Tcsh/Csh, Ksh, Zsh, Fish).

• "Graphical User Interface" (or GUI) - This gives a visual way of interacting with a computer (e.g.: a background, a taskbar, menus, icons, and other things that can be selected with the mouse cursor). The core component of the GUI is a "Window Manager". The Window Manager allows the computer to display the processes going on inside of it visually, as boxes or "windows".

• "Desktop Environment" - This gets the different parts of the GUI to work together (e.g.: it allows different windows to interact so we can do things like drag-and-drop). Some common ones are Xfce and KDE. It may come with specific applications built-in.


Easy Installation

Here, we will give a simple step-by-step procedure for running LinuxMint (a very easy to use Distro derived from Ubuntu). This will let you try it out, and if you want, permanently install it over Microsoft Windows or some other OS. If you are worried about accidentally deleting all of your files, then do all of this on a computer that you are NOT worried about wiping out. [Eli shows how to run a copy of Ubuntu inside of macOS using VirtualBox. This is another option for testing it out if you are hesitant to go through the process described below.]

Step 1: Download the ISO of LinuxMint that looks interesting to you, whether it be "Cinnamon", "MATE", or "Xfce". [This determines the Desktop Environment.] If you are trying to install it on an older computer, use the Xfce edition. If this is not an issue, then it doesn't really matter which one you pick so long as it is compatible with your processor. If you are unsure if your processor is 32-bit or 64-bit, search for your computer model on the Internet to find out, or look at your system settings.

Step 2: Verify the ISO to make sure that it is a legitimate (unhacked!) copy and will install properly. This is an important step. DO NOT skip it. If it checks out, then go to the next step. If it doesn't, re-download it and check it again.

Step 3: Grab an empty USB drive. It will have to be at least ~2+ GBs in size. The ISO has to fit on it.

Step 4: Download and install Universal USB Installer by Pen Drive Linux. This program will format the USB drive and put the ISO onto it. Follow the instructions in the window that appears when you open up the program. Be very careful when picking the drive letter for the USB! Make sure that it is the right one or you might accidentally delete what is on your hard drive.

Step 5: While the test computer is off, plug in the USB drive that you just set up into one of its USB ports.

Step 6: When you turn it on, be prepared to press the key that will open up the "boot menu". It is usually the "escape" (ESC) key or one of the "function" (F) keys at the top of the keyboard. If you do not press the key in time, then restart the computer and try it again until you have reached the boot menu.

Step 7: From within the boot menu, pick the drive letter that matches where the USB is plugged in. LinuxMint should now start up normally. When it starts up, the taskbar on the bottom of the screen works much like an older version of Microsoft Windows. Clicking the little "LM" in the bottom left-hand corner will open up a menu that shows the different types of applications that LinuxMint comes packaged with. Explore it a little to see if you like it.

Step 8: If LinuxMint is something that you would be interested in using regularly, then double-click the icon on the desktop that says "Install Linux Mint". This will guide you step-by-step in overwritting the OS on the hard drive with LinuxMint. Again, be sure that there are no files on the hard drive that you want to save because they will be permanently deleted. Also, be warned, GNU+Linux does not always have the best hardware support (particularly when it comes to things like graphics cards and external hard drives). Make sure that all of your hardware works before installing!

Step 9: After it is installed, a welcome message should appear. Follow what it says. Afterwards, you may still need to do a little bit of housekeeping (e.g.: install other updates / drivers / codecs, set up the firewall, etc.). Not all of these things may be applicable to you.

Congratulations! You are now a Linux user.


Using Basic Commands...

Because LinuxMint has a GUI, we can get by without ever really using the Shell. However, knowing how to use it can be very useful. Sometimes people copy-and-paste commands from various websites into the Shell without understanding what those commands actually do. This is not always a good idea. Instead, let's try to learn why we might use a particular command before we type it in. Please keep in mind that all commands are case-sensitive (i.e.: there is a difference between typing something in uppercase or lowercase, and we must use spaces properly). Some commands are also Distro specific. Here, we are focused on commands appropriate to LinuxMint. [If you are interested, there is also a little interactive course at LinuxCommand.org for learning more.]

...For Closing The Shell

To open the Shell, click the black icon on the taskbar labeled "Xfce Terminal", or press CTRL + ALT + T. The window that pops up is the Shell. This is where we can type in commands.

To close the Shell, type in exit and press ENTER.

...For Learning More

If you input a letter and press TAB, then you will get a list of all of the commands that start with that letter.

Type in whatis followed by a space, then a command, and press ENTER. This will tell you very briefly what that command does.

If you need more information, type in man followed by a space, then a command, and press ENTER. This will bring up a page within the manual that covers that command. Yes, the manual for the Operating System is built into the Operating System! ☺

There is a text reader called less integrated into the Shell. The page that pops up whenever we use the man command is actually a text file. Use the ↑ UP ARROW and ↓ DOWN ARROW to navigate through this text file, or press ENTER to advance through it line-by-line. Press H for a descrption of how to navigate through text files in general with less. Press Q to quit using less.

There is one other way to find out more information about a command. Type in the command followed by a space, then --help, and press ENTER. The information that comes up is very similar to the page in the manual, but it is not a separate text file. It appears inside the Shell itself.

Notice that, outside of a text file, the ↑ UP ARROW and ↓ DOWN ARROW will just cycle through your previously typed commands. This can sometimes make the information that the --help command brings up impossible to scroll through. In order to open up this information in less, type a vertical bar | immediately after --help, followed by the word less, and then press ENTER. This will open up the same information in a text file that you can scroll through with the arrow keys. Again, press Q to quit using less.

More often than not, you will probably use man instead of --help|less, but try both and see what works best for you.

If there is ever too much stuff on the Shell screen at once, type in clear and press ENTER. This will remove all of the previously entered commands and extra text.

...For Navigating Through "Directories" or "Folders"

Whenever we are using a GUI, we usually refer to a specific location on a drive as a "folder". Whenever we are using a CLI, we usually refer to a specific location on a drive as a "directory". Directories and folders are equivalent.

People often use the terms "file" and "folder" interchangeably. However, it can sometimes be helpful to differentiate between the two. A "file" is something with a particular extension. Files can be documents (with extensions like .txt or .pdf), images (with extensions like .jpg or .png), audio (with extensions like .mp3 or .ogg), videos (with extensions like .mp4 or .avi), and so on. Folders can contain files or other folders. Please do not get these terms confused! Again, folders are locations, files are things.

Microsoft Windows uses letters like "C:\" to specify different drives. GNU+Linux does not do this. Instead, all drives are treated as if they are part of a single directory.

Whenever you open the Shell, you will see something that looks like this:

username@machinename: ~$ ■

The tilde ~ means that we are in our "home directory" (i.e.: where all of our user folders are located).

To find out the directory that you are in at any given moment, type in pwd and press ENTER. This will give you the "address" of your location, a list of folders separated by forward slashes /. The letters pwd mean "print working directory", and the "working directory" is your current location.

To get a list of everything within this directory, type ls and press ENTER. The letters ls mean "list", and a list of folders and/or files should pop up. Any text in blue is the name of another directory.

To change directories (i.e.: to open up a folder), type cd followed by space, then the name of that directory, and press ENTER. You will see the text in front of the cash sign $ change to show that you are now within a different directory. The letters cd mean "change directory".

We can jump to any directory that we want if we know its address. Therefore, we have to distinguish between where we were previously (i.e.: our "relative path"), and the actual address of our current location (i.e.: our "absolute path"). To go back to the directory that we were just in (i.e.: along our relative path), type in cd followed by a space, then a hyphen -, and press ENTER. To go up a folder (i.e.: along our absolute path), type in cd followed by a space, then two periods, and press ENTER. To reiterate:

cd - takes us to the directory that we were in previously
cd .. takes us up a folder within the same address

If you ever want to get back to the home directory, type in cd followed by a space, then a tilde ~, and press ENTER.

The farthest that we can go up along the absolute path is called "root". The home directory is contained inside of root directory. We can get to the root directory by typing in cd followed by a space, then a forward slash /, and pressing ENTER.

If we list the contents of root, we will see a bunch of folders related to the functioning of the Operating System. While not all Distros use the same scheme, the folders here usually follow a particular pattern called the "Filesystem Hierarchy Standard" (or FHS for short). To give a general summary of the folders that you will probably see here and what they contain:

Folder Name Contents
/bin
binaries A "binary" is essentially a program. This is how the system keeps track of applications.
/sbin
system binaries This contains programs related to the system itself.
/boot
bootloaders This contains everything needed for the OS to boot up.
/dev
devices This contains "pseudofiles" related to the hardware of the computer. For example, "sda" is a disk, and a number after it is a partition on that disk.
/etc
et cetera This contains system-wide applications and settings.
/lib
libraries This contains files that are used by the programs within /bin and /sbin.
/mnt
or
/media
mount This contains all external drives (USB, SD, etc.).
/opt
optional This usually contains software that is manually installed, or applications that are self-created.
/proc
processes This contains "pseudofiles" that are generated to describe system processes and the use of system resources. This information is handy for developing programs.
/root
This is the root user's home folder.
/run
This is a "temporary filesystem" (or "tempfs") that runs inside of RAM. It shows the runtime information for boot processes. Everything within this folder disappears with a shutdown or reboot.
/snap
This contains "snap packages", self-contained applications that run differently from normal.
/srv
service This contains service data (such as information related to a webserver or FTP).
/sys
system This is similar to /run. It shows what is going on within the Kernel.
/tmp
temporary This holds file data that is in use. For example, it can contain information for a text document that hasn't been saved yet. If a program crashes, check here before you reboot to try to recover the files.
/usr
user This contains applications installed by specific users. It is different from /bin.
/var
variable This contains files that are expected to change dynamically in size. For example, it can include "log files" (which keep track of what is going on inside of a program) or the "spool" (which shows what is in the printer queue).
/home
This contains all of the user's personal files. It is similar to "My Documents" in Microsoft Windows.

It is okay if none of this makes any sense yet. We just want to give you a general idea of what is in here.

...For Installing/Uninstalling Programs and Handling Permissions

Linux Mint has a program called "Software Manager" (under "System" in the main menu). This program allows one to install/uninstall various apps with just a click of a button (through an interface that is similar to something like Google Play). However, one will eventually need to learn some commands if they want to install stuff that Software Manager doesn't have.

[In Progress...]