This section introduces some of basic aspects of Linux in preparation for the later topics.
Case
Probably the most important thing to remember about Linux is this:
"everything in Linux IS CASE SENSITIVE!!!!"
"This" is NOT the same as "this" or "THIS"
If you enter the wrong case, Linux will either give you the wrong result, give you an error, or give you nothing at all. This
is especially important with option flags used by Linux commands and perform different things based on the case.
You have been warned!!
The Linux Shell
Unlike AmigaOS 4.0 which is a GUI system based around Intuition, with a Shell (or Command Level Interface) for technical
adjustments, Linux is command based system with a selection of GUI interfaces added on top. The standard AmigaOne instructions
for Linux installs KDM as the GUI interface, and although most programs can be run from the KDM desktop, there are times when
you have to get under the bonnet and do some real work using the Shell. On Woody, this is accomplished by clicking on the shell
in the menu bar at the bottom of the screen. On Sarge, you click on the Terminal Command Line icon (which looks like a computer
screen) on the top line of the screen.
The Shell Commands
Let's start by asking "What is a Shell Command?". This is not an easy question to answer, because while Linux has
a number of basic commands they are mainly used for writing scripts, and then these scripts can become commands which are
also part of Linux. In addition, anyone can create their own commands and most packages installed on Linux do exactly that.
This means that it is virtually impossible to compile a complete list if Linux commands that you may need to use.
So how do you figure out what command to use and when? With difficulty! Unix and Linux gurus have been there, and learned
about the commands, but many using Linux on the AmigaOne have not, so we will start by introducing some basic commands to
get you started and show you how to find out what commands are available and how to use them.
Command Syntax
Although some of the commands are simple to use, others can be very complicated to use. Having said that, some of the simple
commands can also be very powerful, and care must be taken when using them. All of the Linux commands are 8 characters or
less, and are often little more than strange abbreviations. All commands may be followed by one or more option flags (these
start with a "-" and may be followed by a value), and more often than not may also have a target value, for example:
ls -l exa*
- The first two characters "ls" is the command for "list directory contents".
- The next two characters "-l" is the option flag which in this example specifies "long list".
- The next four characters "exa*" is the value, i.e. any file beginning with "exa".
The important thing to understand is that you don't all of these values every time as shown below:
| ls |
by itself is the command to list files in the current directory in "short list" format
|
| ls -l |
specifies the -l option to specify the output should be in "long list" format
|
| ls -l -t -r |
specifies the -l option as well as -t which specifies sort by modification time, and -r which specifies to sort in reverse
order.
|
| ls -ltr |
this is same commmand and options as above but in condensed form with a single hyphen.
|
| ls -l example.txt |
specifies the "long list" option and a target value which specifies that only a file called example.txt is to be
listed (in Linux the txt suffix on the end is for your reference only - it is not significant to Linux).
|
| ls -l exa* |
this is similar to the previous command but the target value specifies what is known in Linux as a wild-card where the
"*" implies any value. In this instance it specifies that all files beginning with "exa" are to be
listed.
|
| ls -l * |
in this instance the wild-card is taken to its ultimate value to mean any file. In this instance it produces the same
result as ls -l but the form is often used for other commands.
|
If this all sounds a little confusing, don't worry - it'll get even worse as we progress! Just kidding! Once you grasp the
concept it gets easier and easier to understand. From the example above we have learned the basics of the "list directory
contents" command, which is a command that you will use a lot, and you now have a basic understanding of the format for
issuing commands, but we need to find out what flags and values can be used with it. For that we rely on "man".
Using "man"
With Linux it is important to understand how you can help yourself, and that is where "man", which is an
abbreviation for manual comes to your aid. Virtually every command has usage instructions stored in man which you can access
by typing "man" followed by the command name, for example:
man man
- In this instance we have asked man to display the usage instructions on how to use man.
All of the man usage instructions conform to a standard layout so all of the commands have a similar look and feel, and
although this works for some commands, others can appear rather complicated.
Whenever you use man it uses a tool called "less" (long-standing Amiga users may remember this, along with
more, muchmore etc). But here are some basic instructions for using it:
- "h" displays all of commands understood by less
- "space bar" displays the next screen
- "q" quits out of it
That's all you need to know about "man", "more" or "less".....apart from the fact that
it requires either root access, or it must be setup with suid root access. At this point in time, if you can't access it
using the id you normally log in with, log in as the root user instead for now.
The next aspect we need to understand is Linux Security.