Skip to content

Instantly share code, notes, and snippets.

@noynaert
Created January 23, 2017 16:49
Show Gist options
  • Save noynaert/7e2662c3b4beec1d436bc085a5eb1d8b to your computer and use it in GitHub Desktop.
Save noynaert/7e2662c3b4beec1d436bc085a5eb1d8b to your computer and use it in GitHub Desktop.
Getting your linux system set up, basic concepts, and bash commands.

#Setting up your system, and basic bash Linux is a form of Unix. This document will focus more on the "bash shell."

Most modern Linux distributions have a "desktop" interface that looks something like Microsoft Windows. Some of these desktops, like Cinnamon and Mate look vaguely like Windows 7. Others like Unity look more like Windows 8 or Windows 10.

I will be focusing mostly on the "bash shell." The shell is basically a command line interface. It uses the keyboard. You bring it up in a "terminal window." It is often called "term." Term is only mildly aquainted with the mouse so most interactions happen on the keyboard.

The shell has grown over the years. Now most modern systems use the "Bash Shell." Macintosh also uses the Bash shell. Microsoft has announced that it will be releasing the Bash shell for windows as well. It is worth learning as much as possible about the bash shell if you are in IT.

Users

In unix systems there are ordinary users and a root user. Ubuntu and its derivatives do not allow you to log in as root. You probably should not log in as root, even if your system allows it.

As a regular user you can't do administrative things like install software or printers. If you want to do that type of administrative task you have to temporarily promote yourself to "Super User" status. Root is a super user. We use the sudo command to do that.

Updating Linux

A priority on a linux a new linux system should be to install any updates or upgrades. Do not do this step on a Mac, because it has other mechanisms for updating.

Do the following commands. You should be prompted for a password after the first step.

sudo apt -y update
sudo apt -y upgrade

Some systems like linuxmint have their own built-in update system. I like to make updates automatic. Type the following command.

sudo crontab -e 

The first time this runs it will ask you for an editor. I suggest "nano" if you are new to Linux

If you have a wall of text appear after selecting nano, scroll to the bottom. However it is also possible the crontab will be empty. Add the following to the bottom of the text if there is any.

5 4,16 * * * apt -y update
19 5,17 * * * apt -y upgrade

Save the file using the menu at the bottom of the screen. ^ means the "Ctrl" key. You save the file with ^W (hold Ctrl and press W). ^X should exit

What this will do is run the update program automatically at 4:05 AM and 4:05 PM. The upgrae will be attempted at 5:19 AM and PM. You can adjust these commands to your lifestyle.

Some people do not like to blindly install updates. This is especially true of production systems. But for ordinary users I think automatica updates are safer in the long run.

Installing Terminator

I prefer the "terminator" program rather than just term. We will still be using the bash shell. It will just be in a somewhat more friendly term program.

If you are using a debian-style distribution (like Debian, Ubuntu, or LinuxMint) type the following command. If you are using an rpm based distribution like Fedora or Cent-OS, use "yum" or "dnf" instead of "apt."

sudo apt install terminator

The system should ask for a password. A whole lot of stuff should go on.

Type "exit" at the bash prompt to close the term program. Now use your desktop to open the terminator program.

Cowsay

We will use the "cowsay" program to do some basic testing and exploring. Type the following command

cowsay 'Hello'

If cowsay is installed on your system, you should be rewarded. If cowsay is not installed do "sudo apt install cowsay" and try getting the cow to say hello.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment