This document is a general Linux introduction, with a short introduction to shell scripting as well.
It covers basic Linux usage, with a focus on the command-line, and gives links to more advanced material.
Exercises throughout this introduction guide the learning process.
The top-level URL for this Linux Introduction is: http://www.macs.hw.ac.uk/~hwloidl/Courses/LinuxIntro/.

The main goal of this document is to provide sufficient information on basic Linux and shell scripting
usage to get started on introductory exercises.
By the end of the Section called Basic Linux Usage you should be able to launch commands from the command-line,
compose commands using pipes, and navigate in the filesystem.
By the end of the Section called Basic Shell Scripting Using bash you should be able to write basic shell scripts to
perform repetitive operations.

The context of this guide are under-graduate and post-graduate courses at Heriot-Watt University, Edinburgh,
that rely on basic knowledge of Linux usage. In particular, this guide should provide sufficient context for
assignments in the courses F21CN Computer Network Security and F21SC Industrial Programming.
However, it should be of broader use, and it is designed for such.

Experienced users may want to jump straight to the the Section called Quick Start and follow the links given there.
The material in this introduction is mainly for users with little or no experience with Linux.

First of all, make sure that you have your username and password ready.
You will get these at induction day. If you missed that opportunity,
contact the help desk (room EMB 1.33).

Now, work through the Section called Basic Linux Usage, which takes you through the first steps
of logging in and basic Linux command-line usage. By the end of this section, you should be
able to launch commands from the command-line and get help on the most common activities.

Then, work through the Section called Basic Shell Scripting Using bash, which teaches you basic shell usage in bash
and takes you through a couple of exercises. It starts with simple straight-line scripts,
i.e. sequences of commands that are executed as if typed on the command line, and moves
on to repetitive scripts, e.g. using loops and function calls.

Finally, to deepen your understanding, look at the examples in the Section called Shell Script Examples, save the examples
in separate files, and execute the files as discussed. Make small changes to the scripts to modify behaviour.
By the the end of this section, you should be able to write basic shell scripts, to automate repetitive processes.

The lines starting with $ are executable commands all other lines are the output of running this command. The $ symbol stands for the prompt you see in your terminal window. To do the exercise, cut-and-paste the text after the $ symbol into your terminal window. For example, when you cut-and-paste the command pwd from the example above,
you will get the current directory as a reply. Lines starting with # are comments, explaining
what the commands are doing, and can be
ignored. Try variants of the commands as shown in the introduction to understand what's happening in each step.
Notes at various points will refer you to a more detailed treatment of individual topics.

If in the above example you got an error like

bash: $: command not found

you also pasted the $ symbol. Only paste the text after the $ symbol into your terminal window.