Skip to content

Linux Primer

mcli edited this page Nov 16, 2017 · 2 revisions

Installing Ubuntu

You may install Ubuntu on a new/repurposed PC or running in a virtual guest in VirtualBox. Follow the instructions for installation. The Ubuntu ISO image may be downloaded from the Ubuntu desktop download location.

32-bit or 64-bit?

The development environment supports both 32-bit and 64-bit systems. Which to use is based on whether your CPU supports 64-bit and whether you’re installing in a Virtual Machine. 32-bit distributions are getting phased out, so the best bet is to install a 64-bit system.

If you’re replacing the OS on a computer, determine whether or not your CPU supports 64-bit. Either way, the 32-bit Ubuntu 14.04 installation should work if you are unsure.

For virtual machines, you can choose either 32-bit or 64-bit when setting up your VM. Make sure you download the corresponding iso image for installation.

You will want to install the 32-bit compatibility libraries so you can run programs compiled for a 32-bit system.

Window Managers

If you’re running in VM or on an older system, you want to minimize the processing needed on your system. Replace the slow window manager with a different window manager. Try a few out and see what you prefer. Don’t worry, you can select your window manager when you log in so you are not stuck with the one you install.

Fluxbox

fluxbox is a barebones window manager that supports different workspaces.

sudo apt-get install fluxbox
To use your new window manager, log out of the system, then in the log in screen select the new window manager by clicking on the icon to the right of your login name.

Launching the Terminal Window

The terminal window gives you access to the command line prompt, represented by the `$` symbol in our examples. The command line is used to run all the commands in this tutorial, for system commands, and for development.

To launch a Terminal, click on the top left icon in the Ubuntu application dock and type “terminal” in the search field. Click on the “Terminal” icon in the search results to launch a terminal. Alternatively, you may drag the Terminal icon onto the dock for quick access.

Learning The Linux Command Line

The Linux Command Reference is a good start to learning the Linux command line.

The `apropos` and `man` commands are useful for learning what commands you can run and what those commands do.

To find out about programs that have to do with music, use the `apropos` command:

$ apropos music
rhythmbox (1)        - music player and library for tagged files using GStreamer
To find more information about `rhythmbox`, use `man`:
$ man rhythmbox
rhythmbox(1)                General Commands Manual               rhythmbox(1)

NAME
       rhythmbox - music player and library for tagged files using GStreamer

SYNOPSIS
       rhythmbox [option...]

DESCRIPTION
       rhythmbox  is  a  very easy to use music playing and management program
       which supports a wide range of audio formats (including mp3  and  ogg).
...

bash Key Bindings

These key bindings allow you to move quickly around the bash shell without lifting your fingers from the keyboard.

The `C` in the key binding column represents the Control key.

Key Description
C-f or Right Arrow Move cursor forwards (to the right)
C-b or Left Arrow Move cursor backwards (to the left)
C-n or Down Arrow Move to the next item in your command line history
C-p or Up Arrow Move to the previous item in your command line history
C-a Jump to the beginning of the line
C-e Jump to the beginning of the line
C-u Erase everything from your cursor to the beginning of the line
Tab Command completion. Start typing a command and press Tab to see possible completions

If multiple developers are using a single computer, we recommend separate individual accounts for users for security reasons and to avoid conflicts. Sharing a user account is possible, but requires special care.

In the following examples, replace `<username>` with a unique user name for the developer. The `sudo` command allows you to run a command as a privileged user.

Creating a User Account

If you have sudo capability, creating an individual account is the recommended approach.

To add a user:

$ sudo adduser <username>

Input the requested information when prompted. The user should then be able to log into the computer using `<username>`.

Sharing a User Account

If you do not have sudo capability or if you do not want to manage multiple user accounts, you can use a single account for multiple developers. Each developer must perform their development in their own directory.

For initial setup, create sub directories for each user (the `~` is a short cut for the home directory of the current user):

$ mkdir ~/<username>

When logging in, each user should do their work in their own directory:

$ cd <username>

When using a shared account for git development, be sure to set your user and email prior to making commits.

git config user.name "User Name"
git config user.email "UserEmail@Host"