Linux

May the penguin, our saviour, lead us to greatness


This page is geared more towards people who are new to linux, or who are thinking about installing linux on their computer. I hope you find it helpful, and please send me comments to let me know if you think something needs improvements.


What is Linux?

Whoever said, "You get what you pay for," obviously did not have computers in mind. Often times some of the most expensive computers and software do not perform up to expectations, or standards. That is where Linux comes in. But what is Linux? Where did it come from? What does it all mean?

In short, Linux is a free, open-source UNIX-like operating system created by Linus Torvalds in 1994. It is distributed under the GNU general public license, which is a unique liscense specifying that the code for Linux must be made freely available to everyone. Linux has gained popularity among the worlds computer users because it is highly customizable. Since the source code is available to anyone who wants it, programmers can play aronnd with the code to recieve the maximum benefits out of it.


Is linux for me

That is a very good question, for no one operating system can satisfy everyone in the world. Whether or not Linux is good for you all depends on what you need, and what you want to get out of your computer. Answering these questions should help you decide.


If you answered yes to one or moer of these questions then Linux just may be the operating system for you. A word of caution though, even though I seem to be building up linux as a truly wonderful operating system it is not easy to take care of. Especially when you are just starting out. Thats why probably the first and last questions are a bit more important. Generally, linux is not for the faint of heart, howver if you are up to the challenge there are plenty of resources available, and after a while you will begin to learn power that linux gives you over your computer. If you do decide to install linux I would suggest getting a book about it. One book, Running Linux by O'Reilly is a partiuclarly good book. It walks you through installation, and many administrative tasks which are essential to using Linux effectively. Also there are plenty of resources online. A few of the more useful areas are listed at the bottom of the page, but never underestimate the power of a good google search. In short, Linux is not an easy operating system, and don't expect many of the so-called niceties that Windows offers, but if you master it (which really anyone can) then you will reap the benefits of a superb operating system with much to offer.

Frequently asked Questions and Misconceptions about Linux

If Linux is free how come I see it for sale in computer stores?
There are actually two answeres to this question. The first is that what the companies that sell the Linux OS (and I think its mainly Red Hat that does this) are not actually selling the code. What they are actually selling is technical support. When you buy linux out of the store you usually get some sort of tech-support plan along with it. Of course any question you have you can usually find an answer to online in one of the many discussian boards dedicated to Linux. The other answer to this question is that there really is no law that says you cannot sell Linux code. The only stipulation is that the code must be freely available for people to look at. This is a common misconception about the GNU liscense.

What are the benefits of open source?
The answer to this question can get really long, and people have probably written whole books on this question. However, in short, the answer is quality.

How can you get quality products for free? After all you get what you pay for right?
The cliche, "you get what you pay for" may be correct 90% of the time, however the 10% where it doesn't apply is the computer world. Here's why: Large corporations, such as but not limited to Microsoft, are more concerned about getting out a flashy new product rather than how well it performs. So instead of taking the time to write a quality program that works, they often rush out their products in order to make money. This often results in buggy programs which do not work as well as they should. Which is not actually all that bad, afterall there really is no such thing as a perfect program, which is free of bugs. The problem comes in when these companies basically forget about the code they just released to start on the next version, which instead of fixing the bugs in the first one just merely adds more "flashy features." Also these large companies, with their closely guarded codes, just don't have the manpower to find and fix these bugs. Often times they go unreported, and unfixed forever. In the open source wold, though, anyone can look into the code and fix bugs that they find, and there are thousands upon thousands of programmers out there who can put in their knowledge and fix the bugs. Sure this probably is not good in the short term, for can you imagine how bad linux probably was when it first came out in terms of bugs? However, over the long term the bugs got fixed, and code got better. We are now coming into the time when many open source programs are becoming good enough to make their way into the mainstream of computing, and it shows by all the companies that are using open source code.

So some joe-shmoe who does not know anything about programming can be writting code for software that will be running on my computer?
Well, yes. However there is kind of a Darwinian survival of the fittest method at work here. Someone may make changes to some code, and distribute it. If people do not like it then it will not get used and the changes will die out. On the otherhand if the code is changed for the better then the code will get used and will be around for a while. However, there is another factor involved--pride. Programmers are very narcsisitic. Hence anything that they will not put their name to anything unless they think it is of good enough quality. For a programmer to put out a bad piece of opensource software would be his/her death. Since the code can be seen by everyone it encourages better programming practices, because hey, who wants to be told that their code, which has been worked on for a long time, is no good? It's not a good feeling.

Is Linux really better then Windows or Mac?
Well, that all depends on what you want out of your computer. No one operating system is perfect for everyone. If you are not very good with computers then maybe Winsows or Mac OS is the better choice for you. On the other hand if you program, then Linux provides much better functionality than windows.

Exactly how hard is it to use Linux?
Okay, so I have kinda been dancing around the subject, but have never really given a straight answer. Linux really isn't too hard to use. The hard part of linux comes in with the system administration. Anyone who uses linux on a network can tell you that using linux only involves learning commands, and you can usually lean most of these commands by finding a good website. Or using things called man pages (short for manual), which tells you about each command and the different options you have with them. So using linux on a network where you do not have to do any of the administration is not hard at all. However installing Linux on your home computer is an entirely different ballgame. Now you are the one who is responsible for maintaining the system, and for this you have to know about Linux. However, it is not like you have to know everything about it before you install it on your computer. Most of the things you learn about Linux you learn just by doing. There are enough help sites on the internet to get you through almost every problem, and enough books to teach you the essentials of the operating system. And do not be afraid about making mistakes. If there is one thing I have learned about Linux it is that no matter what you do, it can always be fixed. It is usually just a matter of finding some file that you need, or editing an existing file. In short, even though Linux is not an easy operating system to lean at first, it is not impossible either.


Tips and Tricks

Okay, if you have made it this far it probably means that you allready have Linux installed on your computer. Through my experiences I have learned many tricks that you can use to make Linux more efficient. Also there are many things I have done that you should never do, but if you have I will provide the way to fix the problem.

The .rc file
Every shell has a corresponding .rc file with it. For instance if you are using bash (which is the most likely shell that you are using) the file is '.bashrc' or if you are using the C-shell the name is '.cshrc'. The one exception is if you are using ksh (korn shell) then this file is called '.profile'. The significance of this file is that it sets all the inital setting each time you open a new terminal. This is useful for things that you want evertime you open up a new terminal. For instance the Class Path in java or aliases (more on that later). You can also set your environment up here. For instance at work I use many different computers, but only the linux machines support the --color option for ls. So in my .cshrc file I have a section which checks what kind of system I am on, and if its linux (denoted by i686) then I can set color on ls. Here is what it looks like:

if(`arch` == "i686") then
    echo "ls: color set"
    alias ls 'ls -FC --color'
else
    alias ls 'ls -FC'
endif
Allthough this is getting more into unix shell scripts, and I do not want to go into this. To learn more about scripting, which is extremely useful, find a good website (I list a few here ).

aliases
Another really useful thing in linux (actually it's any unix OS) are aliases. Aliases allow you to turn a huge command into one word. For instance, when I want to run a java file I have to type:
/usr/java/jdk1.3.1/bin/java [filename]
However I made an alias so all I have to do is type in 'java' [filename] and it knows use the command '/usr/java/jdk1.3.1/bin/java'. Allthough it varies from shell to shell, the general form to create an alias is
alias [name of alias] [path of command]


the .aliases file
Putting an alias in the .rc file will give you use of this alias all the time. However it is usually not a good idea to play around in your .rc file too much, cause you may change something you did not want to change and end up causing yourself many headaches. Therefore it is usually good practic to create a .aliases file and have your .rc file source this new file. To do this create your .alias file, and put some aliases into it that you think will make your life easier. Then in your .rc file put the following line:
if ( -e ~/.aliases ) then
    source ~/.aliases
Now everytime you open a new terminal your .aliases file will be sourced.

Mounting drives My computer is setup for a dual-boot, and I have two hard drives. So one hardrive (the smaller of the two) is broken up into two partitions, each containing the files for the operating system (one for linux and one for windows). The other drive is configured for windows, however it turns out that linux can mount a drive configured for windows (called a vfat drive). First you must learn how to mount a drive.

When you mount a drive you are basically telling linux that you want the contents of this device to show up in this folder. The command to do that is:
mount [name of device] [location to show contents]
note: you must be root to issue the mount command
The device names are usually located in the directory /dev, and the place the device is conventionally mounted is the /mnt directory. So to mount a floppy drive, first make sure there is a disk in the drive (that is very important, never mount a drive with no disk in it). Then become root, and use the command:
mount /dev/floppy /mnt/floppy
The contents of the floppy disk can now be accessed in the direcotry /mnt/floppy.

Mounting hard drives
Using the mount command is well and good for a device such as a floppy or CD-rom drive, but hard drives you may want mounted every time you start up your computer. And it can get annoying having to type the mount command everytime you start linux. Thankfully there is a way around this. Find the file fstab in the /etc directory, and make a copy of it. Now take a look at it, you will notice that it has all the devices that linux currently mounts automatically. You probably have an entry that says hdax where x is either one or two depending on how you installed linux. The way linux names these drives is as follows: all hard drives begin with the letters hd. The next letter has to do with the order that drive is detected on the primary IDE cable. "a" is the first drive detected (usually called the C:\ drive on windows), and b is the second drive on the IDE cable. If you have other drives hooked up to other IDE cables then they will get letters c, d, etc. The number after the third letter is the partition. For instance on my hda device I have two partitions, windows is the first and linux is on the second, so I have an entry in my fstab file that starts with /dev/hda2. The second column is where to mount the device (again, usually somewhere in the /mnt directory). The third column tells linux what the drive is formatted for and the last column are some properties. So if you want to automatically mount a second drive add a line that looks as follows:
device name    mount point    file system type    properties
/dev/hdb1 /mnt/second_drive vfat umask=000,user,exec,defaults 0 0
The second line is how you would mount a second hard drive formatted for windows from the folder /mnt/second_drive.

Other Linux Resources


resources
LINUX - my personal howto - This is the linux page of my good friend Corey. He is very knowledgable about Linux and has helped me through many of my problems. He has a a good page about setting up linux with a dual boot.
Linux.com - You can probably find almost anything you need help wise from this website.
rpmfind.net - You can find any rpm you could ever want from this website.
BASH - The website for BASH (the Bourne Again SHell)
Korn Shell - Another type of shell to look at
c shell - The C shell, or csh for short, was developed as a command line language similar to the C programming language. Most people who use csh use the enhanced c-shell called tcsh.
The GNU project - tons of quality, free software that you can download.

Linux discussions
Why linux? - A very thorough discussion on the pros and cons of Linux.

Distribution websites
redhat.com - The most popular distribution in the United States, well supported in terms of online tech support.
SuSE - An excellent distribution for home usage. It is well suited for first time linux users.
Linux-Mandrake - This distribution is known as the best one for new Linux users, however it does have some quirks.
Debian - The difference between this distribution and others is that Debian is completely "corporate free" so it is 100% free. Apparently the online documentation and help is very good.
other distributions - go here for a list of other distributions not mentioned here.

To cite this page:
Information on Linux
<http://www.physics.ohio-state.edu>
[]

Edited by: ray@pacific.mps.ohio-state.edu on

For questions or comments send mail to:  physmike@opermail.com