Linux tutorial, part 1

I thought I'd take a little time and write a tutorial on how to get started with the Linux, Unix, and Mac OS X operating systems. As I write this I'm trying to keep in mind a friend of mine who works strictly on Windows, so I'm writing this from that perspective.

Here then is my "Getting Started with Linux and Unix" tutorial.

Part 1: Background

Since I'm doing this as a series of blog posts instead of really talking to you, I feel like I need to start by giving you a little bit of background. I think it's helpful to understand some of the things you're about to see.

First, Unix was initially created in the late 1960's and early 1970's. You'll find that a lot of the command are abbreviated, and part of that may be due to those people not having actual monitors and terminals like we do today. They worked on machines that were combinations of keyboards and printers, so shorter commands were definitely better. (If you don't like short commands you can create your own longer commands. :)

Second, I think of Unix systems as being programmable. Not only can you use the basic commands I'm going to show here, but you can also combine commands to make more powerful commands. That used to be called "piping" one command into another, but if the concept had been invented today I think people might call these combinations of commands "mashups".

Third, Unix is a multi-user system, from the ground up. Where DOS and early versions of Windows had no concept of many users using one machine at the same time, Unix has always had this concept. So right away you'll see that your home directory on the system is something like /home/adam, or /Users/adam on a Mac. If I had an account on the same machine my home directory would be /home/al, or /Users/al, etc.

Fourth, unlike Windows, Unix systems can come from many vendors. This is great, because it fosters a competitive environment between the vendors. Many, many commands work exactly the same way on different systems. It's typically only when you become a system administrator that you start seeing the differences in advanced commands and the system layout.

Fifth, when we think of Unix today we often think of Linux. The source code for older Unix systems was licensed from AT&T (and then other companies), and those systems had their own hardware and were pretty expensive, but Linux systems are typically free, at least at the entry level. That's because the Linux kernel was written from the ground up by a guy named Linus Torvalds, and many of the commands you're about to see were re-written by an organization named GNU. You'll hear about "Linux distributions", and what they're referring to is that you can get the Linux operating system from many different places. Right now Ubuntu is gaining a lot of press as being a good desktop version of Linux.

Sixth, Unix systems have a concept of "shells". This is only something you really need to know if you're going to use the system at the command-line level. (If you're just using the GUI, you don't need to know this at all.) When you're looking at a Unix system command-line prompt you're using a shell. A shell is a command interpreter. It reads the commands you type in, interprets what you're trying to say, and then (hopefully) does want you want it to do. It's just like DOS in that regards, but there's really just one version of DOS. With Unix systems there are many different shells available, but as a practical matter everyone that I know uses one called "bash", and that's what I'm going to show how to use here.

Seventh, what I'm about to show you is how to work with Unix and Linux commands at the command-line level. With newer Unix systems, including Mac OS X, you never have to see the command-line, you can do everything from the graphical interface. But, if you want to get under the covers and have some fun, this is where it's at. There are a bunch of cool things you can do, and as I mentioned the commands themselves can be combined to create more powerful commands.

I hope that introduction wasn't too long. I just think that some background will be helpful.

In my next post in this series I'll start demonstrating what a typical day looks like for a command-line Unix/Linux user, digging into all the commands I use on a daily basis.

Go on to part 2 >