By Liz Couture
November 9, 2006
1 Introduction
The first question you really should be asking, and probably are asking, is why use Linux? Windows and MacOS are much easier. I'm not going to lie. Linux is difficult, text-based, and complicated. So why even bother? There are some great reasons to use Linux. Linux is an incredibly useful, powerful tool. It gives you the power to get "down and dirty," to communicate directly with your computer. There's a plethora of information that you can get straight from the machine that's pretty much hidden in Windows. It all happens behind the GUI (Graphical User Interface), so you can't really see it, and if something goes wrong, there's next to nothing you can do to find out what it is. That's another thing about Linux. It's easier to debug. You can look directly at the logs and error messages to determine exactly what's going wrong.
There are things you can do with Linux that you just can't do with Windows. To put it figuratively, Linux is a Ferrari. Windows is a Honda Civic. Most people don't need a Ferrari. It's a really, really fast car, but the average person drives the speed limit most of the time. If you're not driving that fast, you'd probably be better off with the Honda Civic. It's just easier, not dealing with the upkeep of that expensive car. That's good enough for most people. But quite simply, you're not getting anywhere near the same performance out of that Honda Civic as you are out of that Ferrari. Everybody knows that. On the topic of expensive, though, Linux is really awesome that way too. It's free. And it's open source, which means there's a lot of resources out there, by tons of different people. The people who wrote the code. The last reason, and probably the most important one to you, is because we say so. Computer classes at Clark University, and pretty much ever ywhere, insist on the use of Linux, simply because it works so well with Computer Programming. So deal.
This module is made to teach the user basic command line interaction and to introduce the user to the shell and to basic Linux commands. To open the command line, right click on the desktop, and select 'Open Terminal'.
2 The first step
Linux can be pretty intimidating, since you're basically dealing exclusively with text, but once you grasp the basics, it can become really useful, especially with resources like www.google.com/Linux at your fingertips. So, to get you started, here's a description of the two commands you will probably be using more often than any other: ls and cd.
ls will give you a list of everything in your current directory.
Open the terminal, type "ls" into the command line, and press enter. You'll see a list of all the files in your current directory. Different types of files are displayed in different colors. For example, blue files are directories. If there's any file that you'd like to execute, just type the filename into the command line. This might include typing in the whole directory ("/home/yourusername/thefilename").
Now, if you want to go to another directory, type "cd" followed by the name of the directory and press enter. cd stands for "change directory".
Now you're in that directory, and you can see the files there. If you'd like to go up a level, simply type "cd .."
3 Learning More: The man command.
If you ever know the name of a command, but don't know what it does, the first place to look would probably be the man command. man is short for "manual", and there's an entry for just about any command you'd want to use. Simply go to the terminal and type "man" followed by the name of the command you'd like to look up. As an example, type "man ls".
The entry will start with the name of the command, followed by a synopsis of how to use it, and a more detailed description. The description will tell you exactly how the command works, followed by a list of arguments. To scroll through it, press the up and down arrow keys. The arguments are things that you can add after a command to change the way it works. To see how to use these, look at the synopsis description. Here, it says "ls [OPTION]... [FILE]..."
So, browsing the description, you can find out that if we want to list all your files in a long listing format, you'd type "ls -al". When you want to exit the manual, type "q".
With this information, it becomes easier to figure out how Linux commands work.
4 More resources
There is a lot of information on Linux available online. A big part of learning Linux is to know how to find information about it. Linux is developed by a lot of different sources, and thus the only all knowing entity is www.google.com. Google even has a specific web search just for Linux resources, located at www.google.com/Linux. By typing in the name of the command, you'll usually bring up a ton of pages that have plenty of information. Try it. Just type "mkdir" into google.com/Linux, and you'll find a whole bunch of pages about what "mkdir" means.
If you don't like the search engine idea, The Linux Questions Wiki has pretty much everything you'll need to get started.
In the next section we will list a number of commands you are expected to know. Use those websites and the information you learn from them to make yourself more comfortable with the basic Linux environment.
5 Things to Learn
6 Things to Try
Here are some ideas to try on your own to get a handle on commands. If you're having issues with any of these things, get a proctor to help you. This should prepare you pretty well for the "show and tell" section next.
7 Show and Tell
To get checked off for this module, you'll need to demonstrate that you can do the following or similar things:
8 Feedback
Would you like to leave some feedback on this module, or this program in general? Send an e-mail to ecouture@clarku.edu.