An introduction to Unix/Linux

The Secret Os That Really Runs The World Duration: 00:12 Posted: 2023-12-21

Why Unix?

So what’s so great about this Unix thing anyway, why is it better then say a Macintosh or Windows PC? Well it’s not. Just as a VW Beetle is not better then a pickup truck. The real question is a matter of functionality and your needs. As much as I like Unix, I don’t believe it’s a one size fits all solution.

Unix is a strong server platform with very powerful capabilities for your data center needs. It makes a great platform for database, web, and accounting services. You can use it for a desktop system as well, but if you like to play shoot-em-up games and buy off the self software, you should consider a Macintosh or a Windows PC.

Unlike other operating systems, Unix is not easy to master. It features a rich set of commands for doing almost anything you can think of. As with anything really powerful, the learning curve is large. If you put forth the effort, it will reward you with a stable and enjoyable system that can serve your needs for the future.

Why I do NOT want to purchase software (or the Unix Philosophy)

Most operating systems are designed for you to purchase commercial software to fully utilize it. Unix was written by programmers for programming, as such it takes a unique approach to your data needs. It provides a large set of commands (more then 600) and gives you the ability to tie them together to perform your tasks. To do this it gives you shells (the glue of Unix) and several programming tools.

The basic idea behind Unix is for you to use what comes with it to handle your needs. If for some reason that does not work, then write a script to do it. You should be able to accomplish most tasks with this approach. What most users and some sys-admins do not realize is what Unix has built into the OS:

Hey can’t I just use a GUI for that?

Unix can be very overwhelming as there are often several ways to do the same task. Some are meant to do quick changes that will not stay in place when a system is restarted. Some are for permanent solutions to your needs. A lot of times you can do a task (adding a user account for an example) in both command line and threw a GUI. Why should you use the command line first? I’ll give you a small list of reasons:

What a difference a shell makes

The shell is both your user environment as well as a programming language. Most standard Unix systems come with at least three (born, korn, and c shell), some have more. The posix standard for a shell is korn (please note: on Linux I would use Bash). This is the one that I recommend for use in programming and as an end user environment. Some people will argue with me on this, the best thing to do is to use one of the big three and stick with it until you master it.

I like the korn shell because it has the best programming features. This makes your life easier under Unix. It also supports command line history and editing.

Why vi/vim (or Know Your Editor)

Note: Vim in a modern version of vi and has replaced it on most systems.

vi is the most commonly used editor under Unix. It is the only one the ships with all major flavor’s of Unix that is screen oriented. A lot of folks complain that it is crude and does not support many features. Crude it is, but if you master it, you will find it quite useful for just about any editing tasks you can think of.

Why such a big deal about an editor? Well to begin with most all of the main configuration files in Unix are text. All of the scripts are nothing more then text files. Once you get comfortable with Unix you will find you spend more time editing text files then just about any other task. With that in mind it would make sense to use something that can save you time and effort, as well as be assured that it will be on any system you need to work on.

vi has a lot of features most folks are not aware of:

By far the most powerful feature is the fact that it can read and write to standard input and output. This means that if the OS can do it, so can vi! So you can have the OS sort lines, check spelling, lookup words, format text, and much more.

I highly recommend that if you are going to be spending any time in Unix that you purchase a book on vi and read it cover to cover.

Portable coding

This is one of my biggest pet peeves. In Unix (as well as on other platforms) we have several ways to write code. The ability to write once and run anywhere is not a new concept. If you are careful about how you write your code, you should be able to port your code to another flavor of Unix or another platform with little to no effort.

Unfortunately, this is often not done. The reason is that most programmers want to take advantage of a special feature to jazz up their programs or speed up execution time. Also some development tools generate code that ties the developer to one platform or tool. Microsoft is the master of this, but they are by no means the only company that does this.

An example of this would be using Front Page to setup you web page. It will let you use fonts that are only used in I.E.. Active X is also used as well, for support through Windows only platforms. Using a lot of plug-ins that are not cross-platform is common as well. All of this will limit the type of browser and platform that can view your page. If your goal is to allow as many people to view your page as possible, then you just defeated it. Not to mention that the performance will be poor compared to a clean HTML page.

This is a problem that I see daily in the following development areas:

GNU is Not Unix

Believe it or not, that is what GNU stands for. If I can not use Unix tool to accomplish a task, and I don’t have the time to write something (or ability), then I look to GNU. This is freeware, plain and simple. But do not underestimate it, some of the best code I have seen is GNU stuff. And the price is right!

Games, what games?

Believe it or not we do actually have games for Unix. Some are commercial, some are freeware and others are shareware:

So it is a unique operating system, one that takes hard work and practice to master. One thing you will find though…..

Once you do learn it, you will not want to use anything else!