Getting Started with Linux - IndiaStudyChannel.com

southdakotascrawnyData Management

Nov 29, 2012 (4 years and 6 months ago)

599 views


Getting Started with Linux: Table of Contents

Getting Started with Linux
-

Course Material

Lesson One

Objectives

What is Linux?

Installing Linux

An actual ins
tall

About Debian GNU/Linux


Lesson Two

Installing Debian GNU/Linux

Partitioning

Plunk that CD in the drive

Sundry installation tasks

Reboot and basic configuration


Completing the install process



Lesson Three

Working with Linux
-

First Things First

Working as another user

Lesson Four

Creating your 'routine' in Linux

The Linux file system

The basic directory structur
e in Linux

Some more cool short cuts

In Linux, everything is a file

What's left


Lesson Five

Day to Day with Linux

Virtual Terminals

Text editors in Linux

Text editors in Linux
-

Cont'd


Lesson Six

Shells in Linux

Frequently Used Shell Commands


The 'cp' command

The 'mv' command

The 'mkdir' command

The 'rm'

command


Lesson Seven

Plumbing with "pipes" in Linux



Lesson Eight

How to get more information with Linux


Lesso
n Nine

Other interesting and useful commands

The 'grep' command


Lesson Ten

Power user commands

'tee', '>', '2>'

'whoami', 'whereis' and 'which

'echo' and 'wc'


Lesson Eleven

Miscellaneous commands


Lesson Twelve

Becoming a super user


Lesson Thirteen

Commands to control your system

kill'

File systems in Linux

Mounting file systems

Umount command
-

unmounting file systems


Lesson Fourteen

File permissions in Linux

'chmod' explained

Using 'chown'


Lesson Fifteen

Backing up your files

Untarring and unzipping files


Lesson Sixteen

Installing New Programs


Debian Updates

Installing new programs on Slackware


Lesson Seventeen

Printing

under Linux

Using Linux to access the Internet

ADSL with Linux

Dial
-
up connections with Linux

Getting in touch with your ISP


Lesson Eighteen

Gett
ing Linux to make sounds


Recording Sound

MP3 format

Ogg format

Compact Disks


Lesson Nineteen

Graphic User Interfaces with Linux

The GUI family tree

X
-
Window configuration

To boot or
not to boot (in graphics mode), that is the question.

Choosing the look that's right for you

Protecting the
environment


Internet Browsers

Email clients

Office suites, word processors and spreadsheets

Little goodies to improve your quality of life

Tips an
d Tricks for X
-
Window


More X
-
Window Tips and Tricks

A final word about X
-
window


Lesson Twenty

The end of the beginning



Getting Started with Linux

We have developed this course for one basic reason: To bring the newcomer to Linux to the point where you
can, using Linux, do everything that
you do with

MS

Windows

and much more. Due to the fact that Microsoft,
enjoying an illegal monopoly, has its operating system installed on 90% of the world's computers, th
is course
is mainly aimed at people who want to migrate to Linux from Microsoft products.

The simple fact that you are getting this course off the Internet presupposes that you know how to use a

PC
.
The course should be oriented towards people migrating from other OSes and in particular, MS Windows 9x,
ME, 2000 and XP.

Our objectives are:

1.

To explain the differences between working with Linux and working with other popular
OSes.

2.

To stress that the somewhat steeper learning curve in Linux will pay back in the amount of stability
and flexibility.

3.

To show that using Linux opens up a whole new world of

computing


. This means that a Linux user is not just a passive subject reacting to what the OS allows him/her to
do but he/she is an active "developer" with complete con
trol over the operating system.

[Next]




Preparation

What is Linux?

Linux is an operating system that evolved from a

kernel

created by Linus Torvalds when he was a student at

the University of Helsinki. Generally, it is obvious to most people what Linux is. However, both
for

political

and practical reasons, it needs to be explained further. To say that Linux is an operating system
means that it's meant to be used as an alternative to other operating systems like
MS
-
DOS, the various versions
of

MS

Windows
, Mac OS, Solaris and others. Linux is

not

a program like a word processor and is not a set of
programs like an office suite.

A
brief history of Linux

When Linus Torvalds was studying at the University of Helsinki, he was using a version of the UNIX
operating system called 'Minix'. Linus and other users sent requests for modifications and improvements to
Minix's creator, Andrew Tan
enbaum, but he felt that they weren't necessary. That's when Linus decided to
create his own operating system that would take into account users' comments and suggestions for
improvements.

Free Software pre
-
Linux

This philosophy of asking for users' commen
ts and suggestions and using them to
improve

computer

programs

was not new. Richard Stallman, who worked at the Massachusetts Institute of
Technology, had been advocating

just such an approach to computer programming and use since the early
1970's. He was a pioneer in the concept of 'free software', always pointing out that 'free' means 'freedom', not
zero cost. Finding it difficult to continue working under conditions tha
t he felt went against his concept of 'free
software' he left MIT in 1984 and founded GNU. The goal of GNU was to produce software that was free to
use, distribute and modify. Linus Torvalds' goal 6 years later was basically the same: to produce an operati
ng
system that took into account user feedback.

The kernel

We should point out here that the focal point of any operating system is its 'kernel'. Without going into great
detail, the kernel is what tells the big chip that

controls

your

computer

to do what you want the program that
you're using to do. To use a metaphor, if you go to your favorite Italian restaurant and order 'Spaghetti alla
Bolognese', this dish is like you
r operating system. There are a lot of things that go into making that dish like
pasta, tomato sauce, meatballs and cheese. Well, the kernel is like the pasta. Without pasta, that dish doesn't
exist. You might as well find some bread and make a sandwich. A

plate of just pasta is fairly unappetizing.
Without a kernel, an operating system doesn't exist. Without programs, a kernel is useless.

1991, a fateful year

In 1991, ideal conditions existed that would create Linux. In essence, Linus Torvalds had a kernel

but no
programs of his own, Richard Stallman and GNU had programs but no working kernel. Read the two men's
own words about this:

Linus:

"Sadly, a kernel by itself gets you nowhere. To get a working system you need a shell, compilers, a
library etc."

RMS:

The GNU Hurd is not ready for production use. Fortunately, another kernel is available. [It is called]
Linux.

So combining the necessary programs provided by GNU in Cambridge, Massachusetts and a kernel, developed
by Linus Torvalds in Helsinki, Finland, L
inux was born. Due to the physical distances involved, the means
used to get Linus' kernel together with the GNU programs was the Internet, then in its infancy. We can say
then that Linux is an operating system that came to life on the Internet. The Intern
et would also be crucial in
Linux's subsequent development as the means of coordinating the work of all the developers that have made
Linux into what it is today.

Linux is introduced

Late in 1991, Linus Torvalds had his kernel and a few GNU programs wrappe
d around it so it would work
well enough to show other people what he had done. And that's what he did. The first people to see Linux
knew that Linus was on to something. At this point, though, he needed more people to help him. Here's what
Linus had to sa
y back in 1991.

"Are you without a nice project and dying to cut your teeth on an OS you can try to modify for your needs?...
This post might just be for you."

People all over the world decided to take him up on it. At first, only people with extensive com
puter
programming knowledge would be able to do anything with that early public version of Linux. These people
started to offer their help. The version numbers of Linux were getting higher and higher. People began writing
programs specifically to be run un
der Linux. Developers began writing

drivers

so different video cards, sound
cards and other gadgets inside and outside your computer could use Linux. Nevertheless, throug
hout most of
first part of the 1990's Linux did not get out of the 'GURU' stage. GURU is a term that has evolved to mean
anyone who has special expertise in a particular subject. That is, you had to have special expertise in how
computers worked to be able

to

install

Linux
in those days.

Linux, at first, not for everybody

Other popular software companies sold you a CD or a set of floppies and a brief instruction booklet and

in
probably less than a half an hour, you could install a fully working operating system on your

PC
. The only
ability you needed was knowing how to read. Those companies

had that intention when they actually sat down
and developed their operating systems. Linus Torvalds didn't have that in mind when he developed Linux. It
was just a hobby for him. Later on, companies like Red Hat made it their goal to bring Linux to the p
oint
where it could be installed just like any other operating system; by anyone who can follow a set of simple
instructions, and they have succeeded. For some reason, though, Linux hasn't completely lost its 'Gurus only'
image. This is largely because of
the popular tech press' inability to explain in a meaningful way what Linux
is. The truth is that few tech reporters have real life experience with Linux and it is reflected in their writing.

Linux Today

Today, Linux is enjoying a favorable press for the m
ost part. This comes from the fact that Linux has proven to
be a tremendously stable and versatile operating system, particularly as a

network

server
. When Linux is
deplo
yed as a web server or in corporate networks, its down
-
time is almost negligible. There have been cases
when Linux servers have been running for more than a year without re
-
booting and then only taken down for a
brief period for routine maintenance. Its co
st effectiveness has sold it more than anything else. Linux can be
installed on a home PC as well as a network server for a fraction of the cost of other companies' software
packages. More reliability and less cost
-

it's ideal.

If you're reading this, you
're obviously here to learn how to use Linux. Any learning experience means opening
up to new ideas and new ways of doing things. As mentioned before, Linux is in the

UNI
X

family of operating
systems. UNIX is primarily designed to be used by professionals. You will have to learn some UNIX concepts
in this lesson, but that doesn't mean that Linux is a professionals
-
only operating system. In fact, most major
versions of Linu
x are designed to be as user
-
friendly and as easy to install as any other operating system on the
market today.

Now that you know what Linux is and how good it is, there's one more thing we have to do
-

install Linux!













Next


Installing Linux

Some preliminary considerations.

There are many different versions of Linux. Unlike other commercial

operating systems

that are controlled by
one company, Linux is free t
o distribute and use. So, in the Linux world, there is a situation unlike what occurs
in the proprietary operating system world: a number of companies, organizations and individuals have
developed their own "versions" of the Linux operating system, known a
s

distributions
. There are versions of
Linux that were developed to be installed on computers that receive heavy traffic, so to speak, like
webpage

servers
. Some were developed to be used in

networks

where security is a priority; where sensitive
information

should only be accessed by a privileged few. There are versions of Linux that are meant to be
installed on top of an existing operating system like Windows so people can try out Linux under familiar
conditions. There are versions of Linux that are designe
d to be installed on platforms like Macintosh. There are
versions of Linux with funny names like "Chainsaw Linux" (no kidding) and "Tutti
-
Frutti Linux" (yes, it's a
joke)

What Linux is right for me?

This is a very difficult question to answer. To use an an
alogy, if I were going mountain climbing, I would need
specific clothes to protect me from scrapes, the cold, wind, rain and other adverse climactic conditions. If I
were going to a formal dinner, I would need a tuxedo. If I were going about my daily routi
ne, I would wear
"normal" clothes. There are computer world equivalents of mountain climbing and formal dinners as well as
just sitting around the house. Linux has been fit into all those environments and more. There is even the
equivalent of a swimsuit in

Linux
-

a very scaled down version
-

just to cover the essentials.

Most PC

users

probably just need the everyday version. This kind of Linux has been widely available
for some
time now. Since

Microsoft

makes its living selling people "ordinary" operating systems, they have a lot to lose
if Linux ever gets popular with the masses. For t
his reason they have done everything in their power to "warn"
the public that Linux is something that you probably don't want and don't need. But in reality, Linux is just as
easily installed and supports just as wide a range of hardware as

Microsoft

Windows

does. The PR department
at Microsoft is coming up with fewer and fewer reasons not to use Linux.

Linux on PCs containing Intel
-
based CPUs

It would be impossible to cov
er all of the different types of Linux so this lesson will only deal with standard
versions of Linux that are meant to be installed on PCs with Intel
-
based CPUs. You may have heard of some
of the companies and organizations that have created distributions
for this platform, like Debian, Mandrake,
Red Hat and SuSE . There are others as well. There are even versions of Linux that offer documentation and
install programs in languages other than English. We should say here that it is not our intention to endors
e the
products of the companies we have mentioned here nor do we want to slight those companies that we haven't
mentioned.

Linux Online maintains a

list of all kinds of distributions
. We invite you to consult that

list before deciding on
installing any version of Linux.

Prepare your manuals

As we mentioned before, the major versions of Linux have perfected their products to such a degree that they
are very easy to install. Well designed programs will take you
through the process of installation step by step
so that you will be able to get Linux up and running in a relatively short period of time without any headaches.
But even commercial operating systems that are billed as being the most user
-
friendly in the w
orld can't
guarantee a 100% problem
-
free installation.

The best thing to do before attempting to

install

Linux

is to get the manuals that came with your PC out of the
clo
set and dust them off. Major distributions of Linux have taken into account most standard hardware such
as

videocards
, modems and sound cards, but as we said before, nobo
dy can guarantee a problem
-
free
installation for any operating system. Though you probably won't need them, they may help to track down a
problem or prevent a future one. Now, go get those manuals, and we'll meet you in the next lesson!

[Previous]

[Next]



An actual install

Most reputable

PC

resellers

will hand you a stack of manuals when you buy your machine. But let's imagine
that you got a hand
-
me
-
down PC from your big brother or sister or you picked up
your PC at a garage sale or
you got the PC from some other source that we really don't want to know about. You may be luckier than you
thought. Linux will actually install more easily on older PCs than on some newer ones. Then again, it depends
on how old
it is. Don't try to

install

Linux

on one of those

old

PCs

with a monochrome monitor
where
everything comes out a yucky green color. That's TOO old!

Do you want a 'Dual
-
boot' system?

OK, with or without manuals, now it's time to install Linux. You've got your version of Linux and you just
can't wait to use it. But there are a couple of que
stions you need to ask yourself.

1.

Do you have another

operating

system

installed?

2.

Do you want to continue to use it?

If you want to keep an existing operating system, and
install Linux as well, you will have what is known as a
"dual
-
boot" system. That means that you have a PC that can use two different operating systems. I think that I
should pause here and say that everything that you can do with your garden variety operat
ing system, you can
do with Linux. That means word processing, databases, spreadsheets, Internet browsers, e
-
mail, photo touch
-
ups, MP3, CD Players, cameras and then there are a lot of things that Linux has to offer on top of all that that
other operating
systems don't. The important thing is that you have the option to have both. Now, back to the
install.

Downloading Linux

One of the most misunderstood concepts of Linux is that it is widely spoken of not so much as a "free"
operating system but as a "freeb
ie" operating system. 'What's the difference?' you may ask. The "free" ideally
refers to the

source

code

of Linux. Microsoft won't give you the source code to their produ
cts so you can make
improvements (and we all know how much they need them), but the majority of

Linux

distributions

come with
the source code
-

or at least for the progra
ms that aren't proprietary.

The "free" that most people think of is the free of "freebie" or "handout". This is somewhat fictitious. The truth
is that there is nothing in this world that comes at zero cost. If you happen to have a fast Internet connection
and a CD burner, you may download

ISO

images of the Linux distribution you have chosen (and that lets you
have them free of charge), but it has cost you money for the CDs and
your time (the costliest thing of all).
Linux really should never be touted as a zero cost option, but better as an operating system that can be obtained
and maintained at a very low cost.

If you don't happen to have a fast connection and a CD burner, you
can still get Linux, though, at very little
cost. You can pick up a nice boxed set from the makers of commercial distributions. Personal PC users can
pick up a nice operating system for home use for around 30
-
50 US dollars. These usually come with 90 days
of
tech support, via email, in most cases. You can also get Linux from PC magazines that will often provide CDs
of the major Linux distributions and some basic installation instructions for just the cost of the magazine.

Our pick for an example walk
-
throug
h installation and setup with be Debian GNU/Linux.

[Previous]

[Next]

Debian GNU/Linux

As it would be impossible in

this course to talk about and give installation instructions for

all

of the Linux
distributions, we have chosen Debian GNU/Linux for an example install. Why have we chosen this
distribution?

It is:

1.

A solid, quality Linux distribution with a long history
(in Linux terms)

2.

Non
-
profit and non
-
commercial (which lets us off the hook on a lot of issues!)

3.

Applicable to a wide range of uses and users, from newcomer to seasoned IT professional.

4.

Easily obtained and updated.

About Debian

The Debian project was
founded by Ian Murdock in 1993. Debian gets its name from the combination of Ian
Murdoch and his wife Debra's name (Deb
-
Ian)
.
One of the Linux community's most illustrious people has been
a primary developer of Debian. I'm talking about Bruce Perens. He wa
s one of the founders of Pixar, the
company that created the Toy Story films, Monsters Inc. and Finding Nemo.

Debian has no company behind it. The Debian project is sponsored by

Software in the Public Interest
, a non
-
profit organization dedicated to helpin
g produce open
-
source software and hardware. Despite its not
-
for
-
profit
status, Debian is an extremely versatile distribution. It forms the base of many user
-
friendly distributions like
Ubuntu, Linspire and Xandros. It can also be found running on thousand
s of mission critical servers that have
to be up 24/7.

Though the installation procedure is not as easy as some commercial distributions, it cannot be described as
difficult either. We will go over this in more detail shortly. The major advantage to Debian

is that it can be
updated easily via their much lauded

apt
-
get

system.

Getting Debian GNU/Linux

If you have a broadband connection (cable, xDSL or better), you can easily obtain this distribution and install
it. There are two major ways to do this. The mo
st popular is to burn the Debian

ISO

images

to CDs and install.
If you have a CD burner, this is an ideal option. The second is to obtain a minimal ISO image especially
d
esigned for an install over the Internet. With this option, the files are downloaded as the installer needs them.
This can also be done by downloading floppy disk image files instead of CD images. More information on
these methods can be found at

http://www.debian.org/distrib/

If you don't happen to have a broadband connection, downloading Debian would be an extremely frustrating
experience. You may want to consider contacting a local distributor of Debian CDs.

Consult this page for
further information about distributors in your area:

http://www.debian.org/CD/vendors/

Installation from CD

This is probably going to be the most common way of installing Debian, so w
e go over installation using this
method.

Preliminary considerations

You may be wondering if you can keep another

operation

system

(ie. MS Windows
-

which other one is
th
ere?) on your computer. You can.

Are we going to explain how to do it? Not in great detail. Why? There are a couple of reasons:



Lack of experience with the newer

Microsoft

products
.


The author must admit that he's installed a great number of Linux distributions side by side with
Windows 9.x products. He hasn't done it with any of the more recent ones, so advice on doing it
would be of dubious quality.



There's very

little you can do with Microsoft products that Linux won't let you do as well.

Enough said there.



We don't work for

Microsoft

We advocate

alternatives

to Microsoft produ
cts and not the continued use of them, even in a "second
fiddle" role.

What we can say about dual
-
booting

If you happen to have MS Windows 9.x you must repartition your hard drive to make room for Linux. You can
either erase the drive and

repartition a blank drive or you can attempt to repartition a working hard drive.
Ideally, what was done in the "old" days was to

install

Windows

in C: and D: partitions
. This is relatively easy
to deal with. As a matter of fact, my first install of Slackware Linux was on the D: partition of my Windows
workstation.

If you've got one partition with Windows on it, there are some supposedly non
-
destructive re
-
sizing tools.
T
hey always tell you to back up your data before proceeding, so I always figure
-

what's the use in re
-
sizing
when you can start clean from scratch. You may decide you want to throw away Windows all together!

Summing up, I recommend Linux
-
only installations
. Linux has become quite "mature" as an end
-
user

operatingsystem
, so I find these stories about being "weaned" off Windows to be ridiculous (the
exception, supposedly, be
ing those who run the

financial

software

'Quicken'). If you've bought a new car, you
don't have to be "weaned" off that. You just trade in the old one and start driving t
he new one. The graphic
user interfaces available plus the ever
-
growing numbers of productivity applications (office suites,
browsers,

email applications
, etc.) make it s
uch that a MS Windows user could have his/her workstation
switched with a Linux machine overnight and they would barely break a sweat getting used to it. Everything
works very much in the same way.

[Previous]

[Next]

Installation of Debian GNU/Linux

Booting from a CD

Chances are, if your PC is less than 5 years old, you can start a

Linux installation

right from the CD
-
ROM
drive. The way to find out is to look at your computer's BIOS. There's really no need here to go into what your
BIOS is or what it
does. Let's just say that it's there and you need it for your computer to work. When you turn
on your computer, there's a little message that says 'Press DEL to enter setup'. Anything that mentions the
word DEL usually scares people. It shouldn't. Pressing

DEL when your computer boots up will just get you
into the BIOS setup tools. It won't get you into trouble, unless of course you start pressing buttons randomly.
You'll see a blue screen

pop

up

with some menu items. What you need to select is the item 'BIOS FEATURES
SETUP' You'll see some more menu items. There's one that says 'Boot sequence'. That's the one you want. If
you use the page up/ page down keys, you can set th
is item so that it says CD
-
ROM first. That just means that
it will look for the disk in your CD
-
ROM drive first when the computer boots. Press ESC and then choose the
item 'SAVE AND EXIT SETUP'. Don't forget to set it back to 'C' when you're finished

installing

Linux
. We'll
remind you later.

If you can't boot from your CD there's an option to create a boot floppy. In your machine's BIOS, you might
just see A,C
-

C,A and th
ere's no CD
-
ROM mentioned there. Don't panic. You can make a boot floppy. They
often come with boxed sets, but if you yours didn't come with one, we'll cover how to create one further along.

[Previous]

[Next]

Getting Started with Linux
-

Lesson 2

Partitioning

Your hard disk is like a pie. You can divide i
t into sections. Unlike a pie, after you've divided it, you can't give
a piece to the dog. My dog did try to eat my hard disk once and he really relishes the floppies I leave lying
around, but alas, I digress. For example, if you had two partitions, popula
r operating systems would generally
call them C and D. You can call them Ginger and Fred, or Ginger and Marianne or even the Professor and
Marianne if you like. I just use these bad jokes as a way of saying that C and D are naming conventions that
belong t
o other
operating

systems
. Linux doesn't use them. Linux may call them /hda3 and /hda5 for example.
We'll get to that in a minute. Then you will need another partition
known as a 'swap' partition. This 'swap'
partition is just a way that Linux uses to get more memory so that you don't run out of it.

The classic way of partitioning your hard disk is with a program called 'fdisk' The program comes with a lot of
whistles an
d buzzers and flashing messages that say "Danger, Will Robinson". There's a version for Linux but
it doesn't mention Will Robinson. We want to say here that this is the SWAT team method of doing it
-

the
scorched
-
earth policy of partitioning. If you have t
hat important term paper on your hard disk, or pictures of
that dream vacation to Hawaii that you haven't shown to your Aunt Betty yet or your best DOOM scores,
you'll need to make back
-
up copies of them. The re
-
partioning using this method will get rid of

them
-

forever!
[cue ominous organ music].

But

installing

Linux

isn't dangerous and if you choose to install you may not need such a drastic solution to
your partition p
roblem. As we mentioned before, If you're fortunate enough to have a hard drive with more
than one partition (the old C: and D: routine), then it may be just a question of moving some files around.
Unfortunately this lesson can't take into account everybod
y's individual circumstances.

There's a tool called FIPS that comes with major Linux versions. This will re
-
arrange your hard drive so you
can
install

Linux
. There are als
o other commercial products that will do the same. That may be an option for
you, unless you've got a hard drive that's bursting at the seams. You should know that any decent
working

Linux

system

-

and by decent, I mean, having the programs that will let you do anything you did with
your Windows system
-

will take at least 2 gigabytes. Please keep that in mind. And if you want those photos of
Hawaii on there, I'd plan for a

bit more

To talk about where Linux and other operating systems should go. In any situation where you've got two things
sharing the same space, like two people sharing the same apartment, one person will always exert his rights
over the other. Other operat
ing systems usually want to be the only ones in the computer, so even though it's
really not going to be this way, you have to install them in the first 'primary' partition, and that way it thinks it's
the only one there. That means installing it in /hda1
in Linux speak. So remember, if you've chosen to go
the

fdisk

route, the other operating system should be re
-
installed first. When you've got that re
-
installed, you
are f
ree to install Linux in what's left. Once you've installed Linux, you can actually see the other system's
partition, sort of like those phony mirrors at the supermarket. We'll talk more about that in another lesson.

[Previous]

[Next]

Plunk that CD in the drive

Okay. Now is the moment of truth. We've got the

CD

in the drive, and we're ready to go.

Restart

the

computer
.
This should now boot the

Linux kernel located on your CD ROM.

What you'll have to do first is partition the hard drive. There is an easy way to do this. You can dedicate the
whole hard disk or non
-
Windows partition (depending on the type of install you're doing). There is a bette
r
alternative. That is to partition your hard disk even further and put "parts" of Linux on separate partitions. For
example, this is the scheme that works for me:

Let's take a 10 gigabyte hard drive as an example. First, you should see how much RAM you ha
ve. From this
figure, you create what's known as a SWAP partition. This is simply a way that Linux uses to get
an

extra

memory
boost. Custom dictates that your swap partit
ion be double your

ram

memory
. So if you've got
256 megabytes of RAM, the feel free to make a 500 megabyte swap partition. Then my partition scheme ends
up looking like t
his:

Partition

Location

Size

swap

/dev/hda2

500 mb

/ (boot)

/dev/hda1

1.2 gb

/usr

/dev/hda3

3.5 gb

/home

/dev/hda4

5 gb

Assign partitions to look like this. Don't worry about the /usr and /home parts. That will come after. You must
indicate here that
you want / to be the bootable partition. /usr will contain most of the programs that will run on
your machine. /home will contain your personal files. This kind of a partition scheme may come in handy if
you have problems with your hard disk. You may be ab
le to save information if it's located in different
partitions easier than if it were only one big partition.

Before we actually assign the other partitions their places and functions, we need to initialize and activate a the
swap partition. Do this now.

N
ow you should initialize the / partition
-

the one that will boot the Linux kernel.

Now, there is what I consider a little glitch in the Debian install. It doesn't really take into account that you
want to initialize /usr and /home partitions. Don't go to
the next step yet. You should go back and initialize
these partitions now before proceeding.

[Previous]

[Next]

Sundry installation tasks

At this point you should have your hard drive partitioned and these partitions assigned to what areas they'll be
housing.

Now, comes the point in the process to install the Linux kernel. You can choose additional parts to add to t
he
kernel, known as modules, to better use your hardware. Debian does a pretty good job of auto
-
detecting what
you have, so there shouldn't be any need to touch anything here. People who know that they're going to have to
use foreign character fonts may wa
nt to add additional support for font sets.

At this point, you'll have to choose a 'hostname' or name for your computer. Use whatever naming scheme is
comfortable for you. After, you should choose a 'domain' name. Even if you're not running
an

Internet

server

and even if you don't have a network you should choose a name as if you had one. Normally
if you were in fact a server providing Internet services, you would choose a

name and append .com, .net etc on
the end. I would, of course, be a name registered with an official

domain

name

registry
. In the case of
a

single

machine

or a network that's connected to the outside only by way of a dial
-
up connection, you should
choose a single name without the dot extension.

Now you should enter your ISP's domain name

server IPs. Each block (the four numbered set separated by
periods) should be separated by a space.

Now, as we're installing from a CD, you should choose 'CD
-
Rom' for the installation procedure. You should
also choose the settings 'make system bootable'.

Your hard disk is basically a piece of metal with a metal disk flying around in it at incredible speeds. It
essentially does nothing unless you tell it to do. At this point, we're going to tell it to boot up the
Linux

operating system
. If you're contemplating a dual
-
boot system, you can also tell it to ask you to choose
from different operating systems at boot. Debian uses a program called 'LILO' to do this. Later, you can

actually make alternative versions of the Linux kernel and have LILO boot them. Right now, your safest bet is
to install LILO in the 'master boot record' when the

instal
l

program

asks you. The "MBR" is a little slice of the
hard disk pie reserved for moments like this!

The program will now ask you to create a rescue floppy. These will come in handy. For example, I have often
made the fatal mistake of *not* correctly confi
guring LILO when I have made a

new

Linux

kernel (yes, you
can make them from scratch!) and my system has become unbootable. You can always rely on a rescue floppy
to get
you out of this situation.

OK, now's the time to reboot the basic system that Debian has installed. You need to remove the floppy and
the CD from the drives. It might be a good idea now, as your machine reboots, to go back into the BIOS and
set it back for

the machine to boot from your hard drive first (instead of from your CD drive). But at least make
sure to remove the CD or else it will boot the CD again and start the install process again.

[Previous]

[Next]



Reboot and basic configuration

Your new

Debian

GNU/Linux system is now
rebooting. When that's finished, you'll have to answer a few
questions about configuration.

You'll now be asked if you want to use Md5 passwords. Without getting into a lot of technical jargon, Md5
passwords are protected with an extra layer of

security
. You should choose this if you think you'll be needing
extra security. You'll have to evaluate this on your own. If you don't choose this, you'll be asked if you want a
'sh
adow' password system. Once again, without going into any technical jargon, this is another

Unix

scheme
for extra security. You should always answer 'yes' to this one bec
ause without it, your password, especially if
it's some dictionary word, would become very easy to crack. By the way, you should

never

use a dictionary
word as a password.

As we're on the subject of passwords, now it's time to enter the password for the fa
mous 'root' account. 'root' is
the administrator of the system. It's also known as the superuser account. We'll get into more detail on the
duties and privileges of root later on. Suffice it to say, you should now type in a password for the 'root'
account.

Please choose one that's easy for you to remember but would be difficult to guess or "crack". For
example, if I were a Star Trek fan, I might be tempted to use Spock as a password. Spock probably isn't in the
dictionary, but it might be so well known now
that it would be found in any program that crackers use to get
into systems. Therefore, I would choose something a little less well
-
known in Trek lore and modify it
somewhat. Trek fans will remember that mutant brat who once tried to take over the Enterpri
se, Charlie X.
Well, 'ch4rl13X' might be a good password. Taking some letters and replacing them with similar looking
numbers is an acceptable password procedure. The most secure method is, of course, creating a random string
of lower case and capital lett
ers and numbers and just remembering it. 'C2jl7y2B' is an excellent password. It
is, however, difficult to remember. In the end, everybody comes up with his/own own scheme that works.

Now you should create an account to work with normally. What I mean by "
normally" is that Linux is a true
multi
-
user system, so one machine can be used by hundreds of

users
. When each logs in, he/she is restricted to
modifying only the files
owned by him/her. This insures a lot of security and removes a lot of headaches. You
should never do routine work as root. This account should be only used to perform important administrative
tasks. Feel free to use your first name or the first letter of y
our name and your last name as the login for this
account. Follow the password convention you're comfortable with.

Now, you'll be asked to remove

PCMCIA

from the system i
f yours doesn't use it. Feel free to do so.

You will now be asked if you want to configure your system to use your

ISP
. If you have a dial
-
up connection,
this is a good t
ime to use it. If you connect by way of broadband or better, you can skip this part.

At this point, we're ready to choose the rest of the packages that will make up our Debian system.

[Previous]

[Next]

Completing the install process

Now it's time to begin inserting each one of the CDs you have. They will be scanned for available packages for
install. There is a maxim
um of 8 in the set. Insert each one and wait until you are asked for another.

When you have completed the

scanning

process
, you will be asked to choose another 'apt' source. With
Debian, you can download and update packages automatically right off this Internet with the 'apt' system. We
will configure this later, right now it's best not to choose another apt source besides th
e CDs.

At this point, if you are connected to the Internet by way of broadband for example and the

install

program

can
make a connection to Debian's security site, it wil
l now start searching that site for security updates. From the
time the

ISO

images

are released to the point where you are installing, security flaws may have been found
in
certain programs included with Debian. For this reason a check is made and any programs with flaws are
marked and updated copies downloaded and installed.

After the security updates are finished, you will be presented with the possibility of doing a sim
ple install with
The Debian Task Installer. This will install programs after you have indicated your general preferences from a
menu.

If you are more adventurous, you may choose the more advanced install process by way of dselect. Here you
will choose pack
ages "by hand" from a list of hundreds. Though the dselect interface is not visually appealing
and may appear daunting to newcomers, it is fairly straight forward and is actually quite user friendly in the
sense that it is almost impossible to run into tro
uble with the packages you want to install. If you were to
choose a package that conflicted with something else, you are notified. That way, you can either choose to
keep the package that Debian recommends or "un
-
select" the package so your own choice can
be installed.

At the fork(s) in the road

Here we reach the end of the install section. You will have to do some more work in this department, but due
to the fact that the packages each person might choose and the hardware in his/her machine, we can't reall
y
document accurately what's going to go on from here. Our install road has reached a plethora of forks in it.
Some simple advice: just answer the questions as accurately as you can and you should be fine.

Post Install

We'll assume that you've got a workin
g Debian system now. If you've got a broadband or better connection to
the Internet, you should now configure the apt
-
get system which will allow you to update your system quickly
and painlessly. It will also allow you to get new programs by downloading an
d installing them automatically.

If you have a basic knowledge of

Unix

commands

already, You should go to the directory /etc/apt/ and do the
following (as root). (Even if

you don't, you may want to try it!)

mv sources.list sources.list.old

This renames the file

sources.list

to

sources.list.old
.

sources.list

is what told the 'dselect' and 'apt' programs
where to get the packages to be installed. Now we're going to change
things a bit. We'll tell them to get
packages off the Internet directly. We need to create a new sources.list file and add our new package sources to
it. Do this first:

vi sources.list

This brings up the text editor 'vi'. There are people who love this pro
gram so much, they will challenge you to
a pistol duel at 20 paces if you tell them you think it's lousy. If you have zero experience with Linux or Unix,
'vi' is probably *not* the text editor for you at this point, but with a few simple strokes of the key
board, we can
do what we want for now.

Hit the escape (ESC) key and the letter 'i' and your ready to insert the following.

deb http://http.us.debian.org/debian stable main contrib non
-
free

deb http://non
-
us.debian.org/debian
-
non
-
US stable/non
-
US main contr
ib non
-
free

deb http://security.debian.org stable/updates main contrib non
-
free

You may want to go to Debian's homepage and look up suitable mirror sites nearer to you. I'm sure the people
who maintain the Debian website would appreciate it too!

Now, to sa
ve the file, hit ESC again and ':' the type 'wq' (meaning write
-
quit) and your file is saved.

Now you're ready to keep your Debian system in shape. We'll give you a refresher later on in the course, but
you will probably be making use of these commands
while you use Debian.

apt
-
get update

-

will update your system with the latest security enhances packages. Use:

apt
-
get upgrade
--
show
-
upgraded

to get a little more verbose report of what's going on.

apt
-
get
--
purge remove [program/package name]

removes an
y trace of a program from your
system.

apt
-
get install [program/package name]

-

installs a new program.

Now, let's see what we can do with that Debian system!

[Previous]

[Next]





Getting Started with Linux
-

Lesson 3

Working with Linux
-

First Things First

When you work as root

You have now installed Linux and the first thing you did was login as 'root'. Then you
provided a password so
that you and ONLY you could login to the system as 'root'. When you decide to work as root, you had better
go into a phone booth first and change into a blue suit with a big 'S' on the front because 'root' is known as the
'superuser'

(you can skip the red tights if you want).

That's really not meant to be just a witty reference to the Man of Steel. Actually, it is much more glamorous to
be 'Superman' but root is actually more like the 'janitor' of the

Linux

system
. Root has the keys to everything.
He can shut off the lights, shut off the heat, lock you out of the building; he has to clean up the system and in
the end make sure everything runs. And the

most important thing about being a janitor
-

he sees everything.

'root' is not for routine work

As I mentioned, Linux makes your computer a true multi
-
user system, which means that besides root, you can
and should work as another person. I say 'should'
because doing routine work as 'root' could be hazardous to
your health. When I first started

using

Linux

myself, information was not all that readily available and I stil
l
had that 'one computer
-

one

user
' concept in my brain. It was after I had trashed all of the files and programs
that make Linux run that I realized that working regular
ly as root wasn't a good idea.

[Previous]

[Next]



Working as another user

Well, then how do you do your day to da
y work with

Linux
? That's easy. You do it by working as a

user

other
than root
. You
may pick the name you like. Try your name. If your name is "Bob" then you could create a user
account for 'bob'. By the way, if Prince Charles is reading this, Charles Philip Arthur George is a bit too long
and has spaces, which Linux doesn't like
-

he sho
uld try 'charlie'. One thing I find EXTREMELY helpful is
that with Linux, I can work as different people. It should not be inferred here that I have split
-
personality
disorder. I am just a guy with a couple of different jobs. This way I can organize my wor
k a lot better and
backups are easier this way too.

Adding a new user

Well, Bob, now it's time to create your account. If your name is Hrothgar, use 'Hrothgar' or 'Hrothie' instead of
'bob' for the remainder of the lesson.

Now 'root' has to do this stuff.
Yes, I know I just warned you about working as root, but this is where you have
to exert your authority. Most major distributions have tools to do this. SuSE, for example, has a nice tool
called YAST which lets you add users painlessly. You just fill in th
e correct information. Consult
your

Linux

version

for information on their tools. There is also the get
-
your
-
hands
-
dirty way of doing this.
Actually you won't get your ha
nds dirty unless you're eating barbecued ribs at the same time.

Using 'useradd' and 'passwd'

To add a new user, you can also use the command 'useradd'. Kind of a logical name, isn't it?

Try this:

useradd bob
. You probably won't see any fireworks go off.
You might not see anything. That
doesn't matter. Linux has been told that there's a new user and his name's 'bob'.

Now you should give yourself a password.

Do this:

passwd bob

Linux will ask you for your password. Follow the same advice I gave previously a
bout passwords. Also, don't
use your 'root' password. Like 'one man, one vote' it's 'one user
-

one password'. You will be asked to repeat it.

[Previous]

[Next]

Getting Started with Linux
-

Lesson 4

Creating your 'routine' in Linux

What's in your user directory

When you create a new

user
, there is a directory created for that user in /home. To see what's in this new
directory, you have to do the following.

Go to the /home directory.
-

typing:

cd

/home

you can make sure you're in the /home directory by typing 'pwd'. You'll see this:

/home
.

Now you need to type:

cd bob
.

MS
-
DOS users will be familiar with that one.

You can type:

ls
-
a

to see what's in the directory. We'll go into more detail with th
e

ls

command later. With
the
-
a option, you'll see some files that begin with a '.' (period/dot). Those would normally be hidden from you
if you didn't use the
-
a.

Now you can go to work as 'bob', 'hrothgar' or whoever you happen to be.

[Previous]

[Next]

Getting Started with Linux
-

Lesson 4

The Linux file system

Now's the time to learn a little bit about the Linux

file

system
. We'll learn about where Linux puts it stuff,
where to find stuff and a little bit about what that stuff is.

The Linux shell

When you're running Linux and star
t to type things on that black screen, you are using a

shell
.
Any

operatingsystem

uses a shell to get commands from the keyboard to the

computer
. It's a lot easier than
punching holes in cards like they used to do in the old days. There are actually programs for Linux where you
talk through a microphone and

Linux will carry out commands that you've programmed in advance. It's really
cool. For now, though, we'll concentrate on the keyboard. The most popular shell used for Linux is
the

bash

shell.

bash

means "Bourne Again Shell". It is a free version of the Bo
urne shell and uses a little play
on words, as you can see.

Getting in and out of directories with 'cd'

We saw a few commands in the last lesson, but we didn't go into them much. We will handle a lot of
commands in more detail in later lessons. This lesson

will cover those commands which you will need to see
what's under Linux's hood.

The first one we should look at is 'cd'. Again MS
-
DOS users will be familiar with this. cd will get you in and
out of directories.

Try this one: cd /

This will get you into th
e 'root' or main directory. It's the directory of directories, the king of kings, your show
of shows. The root directory shouldn't be confused with root's directory. That is /root.

[Pre
vious]

[Next]



Getting Started with Linux
-

Lesson 4

The basic directory structure in Linux

Now type this:

ls

You will probably see something like this:

cdrom

home

opt

tm
p

dev

lib

proc

usr

bin

etc

lost+found


root

var

boot

floppy

mnt

sbin



They will be blue in color. Those are

directories
.

The /bin directory

Now type this:

cd

bin

Type

ls

again.

This is the famous bin/ directory. You know, I have always felt this one was misnamed. For example, when
people say, 'That's no good, throw it in the
bin'. Actually, bin/ is one of the most important directories in

Linux
.
You'll find all of the most used commands there. Right now you should be seeing a lot of red (or g
reen,
depending on your version of Linux). Those are programs.

The /etc directory

Now let's look at another directory. There's a long way and a short cut. First the long way.

'cd ..' will get you out of bin/.

'cd etc' will get you into the etc/ directory.

or you can just type 'cd /etc' in the bin/ directory and it will bring you to the etc/ directory .

Anyway, you are now in the etc/ directory. This houses most of the configuration files for Linux. lilo.conf, the
file that tells you which OS to boot is in t
here.

you'll see:

lilo.conf

And you don't even have to type the whole thing. You could just type 'ls li' and push the tab key. Linux will
type the rest for you. Isn't that cool!

[Previo
us]

[Next]

Getting Started with Linux
-

Lesson 4

Some more cool short cuts

Try this one: type

ls m


push the tab key.

Linux

is going to beep a couple of times, but you keep pushing.
You will now see every file in the directory that begins with the letter 'm'

Now add an 'o' on to

ls m


s
o you get

ls mo


-

now push the tab key. You should see 'motd'. This is a file
that contains your

startup

message. SuSE has a famous one that says 'Have a lot of fun!'
. I like that one so I
haven't changed it, but you can change it so that Linux says anything you want when you log in.

Do you want to make sure that

lilo.conf

is still in there? You don't have to type 'lilo.conf' or even part of it and
press the tab key
anymore. You just have to press the up arrow. Your last commands will appear when you do
that.

Your commands are saved in a

history

file located in your home directory. The more times you press the up
button, the farther back in time you go. Pressing the d
own button gets you back to your most recent
commands. Just stop on the command you want and press 'enter'. You can even type the command

history


and all of the last 400 or so commands you've typed will be presented. As you get more proficient
in Linux
, you'll find that this

really
comes in handy. You can often find out the answer to the question:

How did
I do that?

by consulting your shell history.

The /usr directory

Let's talk about using some options with commands.

For example, typing:

ls
-
l


will
give you more detailed information about the contents of a directory.

Try this: First let's go to the usr/ directory by doing

cd

/usr


then type:

ls
-
l


. You will
see more
information, like dates, some numbers, letter combinations. It will say 'root' a lot. We'll get into more detail
about what all of that means later in the course. You'll see mainly sub
-
directories here. The usr/ directory
contains files and progra
ms meant to be used by all of the

users

on the system.

[Previous]

[Next]

Getting Started with Linux
-

Lesson 4

In Linux, everything is a file

Yes, not only is that

digital

photo

of The Eiffel Tower a file but your monitor is a file too! How can that be?
Let's try to explain it.

The /dev directory

If you do

cd

/dev

and then ls, you'l
l see a lot of yellow outlined in black. These are the devices that your
system uses or can use. Everything is considered a file in Linux, so your hard disk is kept track of as a file that
sits there. If you're using an

IDE

hard

drive

(as opposed to SCSI), your hard drive will be known as /dev/hda.
Don't delete that, because your hard disk will spin around, come jumping out of your

computer
, land on the
floor and spill out ooze all over the place. No, not really. You will probably not have to look in /dev very
much, so don't worry about that.

The /boot directory

Doing:

cd /boot

will get
you into the /boot directory. You will not find any boots or shoes or footwear of
any kind there. That's where the Linux kernel usually is. Power users may change the location of the kernel for
reasons of their own (they may prefer /shoe), but it is normal
ly placed there on most systems. You will
eventually have to use this directory, because you may need to use two or more different types of kernels in the
future. That will be taken up in a more advanced lesson.

root's directory
-

/root

If you are not work
ing as 'root' and you type

cd /root
, you will be taken to the directory /root. However,
you won't be able to do anything while you're there. Root's home directory is a restricted area for everybody
else. Linux response is sort of like, 'You don't have to k
now that'. Users' home directories are under certain
restrictions for other users as well.

The /sbin directory

/sbin is another one of those off
-
limits directories. You may look, but you can't touch. This directory is like
/bin in that it has frequently us
ed programs in it, but they're only meant to be used by root. 'Shutdown' is in
there. Only root can shutdown the system. If a user other than root tried to shutdown the system, he or she
would get a message saying that only root can do that. Then that pers
on would be followed by the secret police
for three months.

The /tmp directory

/tmp is a directory that is used to store temporary files, as the name may suggest. You will find later on that
when you use a Windows
-
style system with Linux like KDE, this

window

manager

will create files there for
temporary use. When you double click on an icon of a photo, the photo comes up for you to see but a
temporary file is created whil
e you're looking at the photo. The temporary file is deleted when you close the
KDE image program. It's mainly the programs that work under a windows manager that take advantage of this
directory.

The /var directory

/var is a directory for certain files that may change their size (i.e. variable size) For example, there are a few
excellent databases for Linux. One is called MySQL. Normally, MySQL keeps its data in a subdirectory of
/var called /var/mysql/. If I had an
e
-
commerce website, I would have a database to register purchases. That
database would obviously grow in size. And if it didn't then I'd be in trouble. It is also the normal place
where

email

servers store their incoming mail. Again, email varies in size as well.

The /lib directory

/lib is for library files. That's where the name /lib comes from. Programs
may use libraries to carry out their
functions. Different programs use the same libraries, so Linux will store them here so that every program
knows where to find them. You will probably not have to worry about this directory much unless you start
getting
messages like 'can't find shared library...'. That will sometimes happen when you've downloaded a
program and had to compile it yourself from source. Even then, getting what are known as "dependency"
problems are quite rare. Most programs, even when compil
ed from source, usually have a pre
-
configuration
program that makes sure that they can find what libraries they "depend" on to run. If they don't, they'll tell you
that you can't install the program.

[Previous]

[Next]

Getting Started with Linux
-

Lesson 4

Home Sweet Home

We talked about /home before. This is a directory for storing users' personal files. All of us
have certain
preferences for using programs. These preferences are usually included in configuration files which are also
stored in users' home directories. Most of these files start with a '.' (period/dot).

If you go to your home directory, 'cd /home/[use
rname]' and type:

ls
-
a

you will see these files.

What's left

The /floppy /cdrom and /mnt directories

Most installations of Linux will also provide these directories:

/mnt


/cdrom


/floppy

These shouldn't contain anything. Later on, we'll explain in more
detail what these are for. Let's just say that in
Linux, if you want to see what's on a

floppy

disk

or a CD, you're not going to be able to just click on an 'a:'
icon or
a 'd:' icon. You're going to do

cd /floppy

or

cd

/cdrom

If you try that now you probably won't see anything. As I said, more about these directories later in the course.

Well, we've looked under Linux's hood, so to speak. In the next lesson, we'll take her for a little spin.

[Previous]

[Next]

Getting Started with Linux
-

Lesson 5

Day to day with Linux

Shutting down Linux

At this point you should have installed Linux, and you've looked around at what you have. And then when
you're finished you'll have to shut off your computer.

Actually, there are computers that are never shut off. Imagine if your

ISP



shut

off the computer every night! The Internet is a 24/7 business so that wouldn't be practical. There are also
people who probably just shut off their
monitor
. As you probab
ly get some sleep occasionally, so we should
maybe let our machine have a rest too once and a while. For this, we'll use the

shutdown

command

The importance of the 'shutdown' command

As anyone who's used a computer knows, if you shut off you're computer before you've finished saving work,
or if there's a power outage that shuts it off for you, data will be lost. At first, if you shut off Linux incorrectly
or there was an inopportune th
under storm and you lost electrical power, you could do severe damage to your
Linux

filesystem
. That will very rarely happen these days, but you should always use the

shu
tdown

command
when you want to shut off your computer. Linux will tell you about it if you don't
-

it will run a check on your
hard disk automatically when you use it again. If you have a big hard disk, you might as well go and make
yourself a sandwich bec
ause it's going to take a while. Linux will also run a routine check every once and a
while automatically. You also have our permission to fix yourself a sandwich in these cases too.

Shutdown for a single computer

The most common way of shutting down a sin
gle user Linux system is for you as root to issue the command:

shutdown
-
h now

You use this when you plan on shutting your computer off at that moment, as opposed to some later time.

You'll see a message like:

Linux is going for system halt NOW

It will start to shut off programs that you're computer is using and you'll see it all happening. That's because
Linux is a transparent system. It lets you see everything it's doing. It won't give you a simple message telling
you to wait and then another o
ne telling you you can shut it off now. If something is causing a problem, it will
tell you about it when it starts up and when it shuts down. That way, if you are having a problem, you may be
able to track it down. If you don't know how to solve it, you c
an tell another person what you saw and he or
she may be able to help you.

With the


shutdown
-
h now


command, you must wait until you see the message:

System halted

or

Power down

before you shut off the computer.

Re
-
booting the computer

The other comman
d that you will probably use is:


shutdown
-
r now


If you have installed a dual
-
boot system and you want to use the other

operating

system
, (why would you want
to do th
at?) you would use this command. You will get a similar message as with the
-
h (halt) option that will
say something like:


System going for

reboot

NOW


The basic
reason behind all of these messages is that Linux was conceived to be a networked operating system.
You have people at workstations on the network busily doing their work. The last part of the shutdown
command
now

is fine for a single
-
user home PC, but on a

network

system this would be changed to indicate a
time. That way people would have a chance to finish what they were doing before the system went down for
maintenence.
Using 'now', in a network, would probably be hazardous to the health of the person who sent that
command.

The next time you shutdown your system, you may want to try using some time options instead of just

now
.
For example, you may want to try shutting dow
n the computer at a given time.

shutdown
-
h 20:01

Which will shutdown the computer at 8:01 PM. You could also try:

shutdown
-
h +5

That shuts down the

computer

in 5 minute
s time.

Now you know the correct way to shutdown your Linux system. In the next lesson we'll talk using the system
again.

[Previous]

[Next]

Getting Started with Linux
-

Lesson 5

Virtual Terminals

One of the coolest things that

Linux

has to offer is the concept of virtual terminals.
Back in the days of MS
-
DOS, one program could only be run by one user at a time. Linux in non
-
graphics mode may resemble MS
-
DOS somewhat, but that's where the similarities end. Linux is a true multi
-
tasking, multi
-
user system. Unlike
MS
-
DOS, you can work a
s more than one user with more than one program at a time

The ALT
-
F keys

Let's say, if you were working as a user, 'bob' for example, and you found that you needed to do something as
'root'. You wouldn't have to shutdown the program you were working with.
You could just press

ALT
-
F2

and
Linux will prompt you to login as a different user, in this case, 'root'. You'd just type the root password and
then you can do stuff as 'root'. Pretty cool, wouldn't you say?

The combination of ALT, plus the F keys will all
ow you to login as a different user, or as the same user, but to
run a different program. All you then need to do is type: 'exit' when your finished, and then press ALT
-
F1
again to get back to your original terminal .

A preview of virtual terminals in X
-
wi
ndow

It's true that the 1990's brought us the era of the graphic user

interface
, popularized by Macintosh OSes
and
Microsoft

Windows
. This gave us the opportunity to have various programs running at the same time. The
X
-
window system of Linux will let you do this as well, but then we can add the concept of multi
-
user to it.

If you've been
experimenting with your

windows

manager

already, you might want to try one more thing. The
combination CRL
-
ALT
-
F6 will get you out of your windows manager momentarily so
you can login as a
different user. Pressing ALT
-
F7 will get you back to your windows manager again. We'll mention this again in
the lesson on X
-
window.

[Previous]

[Next]

Getting Started with Linux
-

Lesson 5

Text editors in Linux

If I were to choose one of the main reason why people use

PCs
, I would definitely say for writing. With
a
computer

and a word processing program,

cross outs, white out and crumpled up paper has disappeared
forever. All those old Smith
-
Coronas got put away.

Linux is just as well suited for

word

processing

as any ot
her operating system.There are several excellent word
processing programs for Linux like AbiWord, KWord, part of the KOffice suite and the OpenOffice.org suite's
word processor. We'll talk about these kinds of programs in a later lesson. First, we should t
alk about the
terminal mode

text

editors

that are available for Linux.

Why use a text editor?

A text editor is just like a word processor without a lot of features. All

operating

systems

come with a basic
text editor. Linux comes with several. The main use of a text editor is for writing something in plain text with
no formatting so that
another program can read it. Based on the information it gets from that file, the program
will run one way or another.

The text editor "vi"

The most popular text editor for Linux is called 'vi'. This is a program that comes from UNIX. There is a more
recen
t version called 'vim' which means 'vi improved'. The problem with 'vi' or 'vim' is that a lot of people
don't like it. You have to remember a lot of key combinations to do stuff that other text editors will do for you
more easily.

We should go through som
e basic 'vi' commands, because I have found that 'vi' is good if I want to get into a
text file quickly and change something or I want to write a short note to myself. I generally do not use "vi" for
anything that requires more than about 30 seconds of wor
k, but there are people who swear by 'vi' and do all
kinds of things with it like designing entire

websites
.

Working with 'vi'

Let's make a text file. Type:

vi tryvi

You'll see a line of tildes down the left side and the name

'tryvi'

at the bottom and

[new file]
.

To write something, you have to press ESC and the 'i' key (i for insert). Even if you don't press 'ESC
-
i' it
usually gets the idea that you want to type somet
hing and lets you do it after a few keystrokes. You should get
used to the 'ESC
-
i' keys so you don't end up writing 'ar John' instead of 'Dear John'.

Press ESC + 'i' then type:


hello vi

If you wrote

jello vi


or


jello bi


or something I don't want
to know about, you can always erase your
mistakes with the backspace key.

To save this file, you would press

ESC

then the colon key

':'

then

'w'

(write)

To save the file and quit vi, you would press ESC,

ESC

the colon key

':'

then


wq


(write, quit)

To q
uit without saving, press

ESC, ':' then 'q'
. Vi may protest if you've written something and you don't want
to save it. If you press

ESC ':' 'q!'

with an exclamation point, vi will accept it and not save your changes.

That's

vi

in a nutshell, or more like a

sesame seed. There are a lot of commands in vi
-

and you may explore
those on your own at a later date, on your own terms and in the privacy of your own home.

[Previous]

[Next]

Getting Started with Linux
-

Lesson 5

'pico' and 'joe'

pico' and 'joe'
-

sounds like a

comic

strip
. Actually, they are two other

text

editors

that I like and I think are a
little easier to manage. They're like 'vi' in that you use them to create and edit
non
-
formatted text, but they're a
little more user
-
friendly. Using 'joe' 'joe' was created by Joseph Allen, so that's why it's called Joe. I suppose if
his name had been Hrothgar Allen, it would have been called 'hroth'.

To use 'joe', you could type:

joe t
ryjoe'
.

You won't see the tildes like vi. It looks a little friendlier. The majority of joe's commands are based on
the

CTRL
-
K

keys and a third key. The most important of these is

CTRL
-
K
-
H

which gets you 'help'. Help
shows you the key combinations to use w
ith 'joe'.

The most important thing about 'joe' is the logical concept that you can just start writing if you want. Try
writing anything you want.

To save it, press

CTRL
-
K
-
D
. To save and quit,

CTRL
-
K
-
X
.

To quit without saving,

CTRL
-
C
, (without the K).

If y
ou want to see the other features of 'joe', press

CTRL
-
K
-
H
, as I mentioned before.

My favorite little added feature of 'joe' is that if you edit a file again, it will save the previous file with a tilde
on the end, like

'tryjoe~'

That little tilde file has

saved my life a couple of times. (well, maybe not my life) But
it has saved me a lot of work. I've made some changes to a file and then found out that wasn't a good idea. I
could always fall back on the tilde file, which is a copy of your previous edit.

'
joe' is a very good option for writing those short

text

files

that you'll need.

Using 'pico'

'pico' is another friendly text editor. If you type:

'pico trypico'

You'll
see the commands you need in 'pico' specified at the bottom. You can just start writing anything you
want.

To save the file, press

CTRL
-
o
. To save and quit or to just quit, press

CTRL
-
x

Pico will always ask you if you want to do what you're doing. That's g
ood. Questions like that will keep you
from sending a file into non
-
existence without wanting to. All the other commands you'll need are at the
bottom of the page.

Well, this is our little overview of the main text editors available for

Linux
. In our next lesson, we're going to
need to use one in order to make our work in Linux a little bit safer and easier.

[Previous]

[Next]

Getting Started with Linux
-

Lesson 6

Shells in Linux

Sea shells by the seashore
, Can you say that ten times fast? How about 'Shells in Linux'? That's not as
difficult.
Learning to use shells in

Linux

isn't going to be difficult either.

Why you need to use a shell

As I mentioned in a previous lesson, a shell is just a way for
your

computer

to receive commands. The most
common shell used for working in Linux is the 'bash' shell. Our lesson will deal with that one.

The most common commands a com
puter receives are ones to

copy

files
, move files around, list files and
delete files. Popular

operating

systems

have perfected this to such a degree that they
have

graphic

interface

programs to do all this for you just by moving the mouse around and cli
cking on a few
buttons. Linux has these programs too, but anybody who's seriously thinking of

using

Linux

on a day
-
to
-
day
basic should be familiar with the commands that
you type in by hand. Some people see this as a throw back to
the old days. I see it as a way to have more power over your computer because even those operating systems
that are billed as more 'user friendly' have provided you with a shell, just in case you

need it. And sometimes
you do!

The '.bashrc' file

Before you start using the 'bash' shell you should be aware of a file that sits in your home directory called
'.bashrc'. You'll find a lot of files on the system that end in 'rc'. Those files allow you to
configure a certain
program to run just the way you like it. The best way to find it is to type.

'ls .bashrc'

(ls lists files)

You can open that file with vi, joe or pico, as we talked about in the last lesson.

For example, in your home directory you would

type 'pico .bashrc'

An introduction to aliases

In that file, you can add something called an 'alias'. Everybody knows what 'alias' means
-

'an assumed name'.
An 'alias' in this file are some lines that you write so that your bash shell assumes that one com
mand is really a
variation of it. As you already know, you can modify a command with a dash '
-
' and a letter To see where the
.bashrc file was, you could have typed 'ls
-
a' and that would have shown you every file in the directory,
including those that sta
rt with '.' If you find yourself using these '
-
letter' combinations a lot, you can modify
your .bashrc file so that even though you type the simple command, like 'ls', you actually get 'ls
-
a'.

Some of these aliases may be very important to keep you from s
ending that novel you just wrote into non
-
existence by accident. I have a couple of entries in my .bashrc file to keep me from getting into trouble. They
are:

alias cp='cp
-
v
-
i'

alias rm='rm
-
i'

alias mv='mv
-
i'

Let me explain them.

'cp' is the command to

copy a file to another place or to make a copy of a file under a different name. In order
not to copy a file to a place where there's already a file by the same name, you could type cp
-
v
-
i, (
-
v for
verbose,
-
i for interactive) and it would ask you if yo
u really want to do it in case there's another file by the
same name. Then the
-
v would show you where it went. This is probably a good idea all the time, so you could
create an alias for it in your '.bashrc' file.

'rm' is the remove/delete command. In Lin
ux, this means

gone forever

[cue ominous organ music] You
obviously have to be very careful with this one, because in the bash shell there is really no 'trash' bucket to pick
it out of if you delete it. That's why I've added the
-
i (interactive) command to

my alias, so that it asks me if I
really want to delete that novel I just wrote.

'mv' is for moving files to a different place or renaming a file. I have an alias for it for the same reasons as the
'cp' command.

Adding aliases to the .bashrc file

Well, yo
u now have '.bashrc' open in 'pico' or your new, favorite

text

editor
. It would be a good idea to add this
line first, so you know what you've done.

# my personal aliases

The pound sign (#) tells the shell not to read that line. It's known as a 'comment'. Then you would add:

cp='cp
-
v
-
i'

on the next line write:

rm='rm
-
i'

so we don't send anything into byte heaven without a warning. And finally

mv='mv
-
i'

So you're aliase
s will look like this

# my personal aliases

alias cp='cp
-
v
-
i'


alias rm='rm
-
i'


alias mv='mv
-
i'


Save that file and logout and login again. Now you have a safer, easier shell environment. As you get more
proficient at Linux, you can add more aliases as

you see fit.

Now your shell's ready to go. If you type logout and then login again, your aliases will work. There is also a
short
-
cut. If you type:

source .bashrc

your aliases will be ready to go.

[Previous]

[Next]

Getting Started with Linux
-

Lesson 6

Frequently Used Shell Commands

If you install a

window

manager

like KDE, you can copy, delete, move and rename files by way of a graphic
user
interface

like Konqueror. But as I mentioned before, shell commands are pretty standard in Linux, so we're
going to teach you the ones that you're most likely to use. You can use them both in text mode or in your x