Unix

From HvWiki

Contents

What is Unix

Unix is a very powerful and widely used computer operating system. It was developed at Bell Labs in the 1960s, and over the years has fragmented into a whole range of similar Unix-ish OSs. It is sometimes referred to as Un*x because (a) there are so many different versions and (b) "Unix" is a trademark. The most popular Unix-like OSs you are likely to find nowadays are:

Linux

Linux is a free open-source version of Unix. It is mainly targeted at PCs but there is a version available for almost every kind of computer in existence now, most importantly Apple Macs and Sun workstations.

MacOS X

 MacOS X 10.4 Box
Enlarge
MacOS X 10.4 Box

MacOS X is a BSD based operating system developed by Apple for their PowerPC based computers. MacOS X is largely successful due to its ease of use, while retaining the power, sophistication, and expandability of a *n*x operating system. MacOS X runs on the Darwin Kernel (currently Darwin 8.1 in MacOS X 10.4 'Tiger'). Darwin employs multiple technologies, most notably Mach 3.0, operating services based on 4.4BSD, high-performance networking facilities, and support for multiple integrated filesystems.

The Darwin kernel sources and binaries can be downloaded from OpenDarwin.org

FreeBSD

A free version of the BSD Unix developed at the University of California, Berkeley. Runs on PCs, Sun workstations, and DEC Alpha.

Solaris

A proprietary Un*x developed by Sun Microsystems for their Sun workstations.

What is it good for

Unix is an industrial-strength OS with excellent security, stability, multi-user, and networking support. There are a wide range of programming tools and libraries available, many of which are free. It is well suited to servers, scientific computing, programming, hardcore data crunching, and such like. Historically it has been pretty forbidding to the "newbie" but many modern versions have a friendly Windows-like GUI over the top of it all.

Summary of the main features

Here are some things about Unix that may surprise you if you have worked with other OSs. See the Linux basic guide for a more detailed treatment.

  • Everything is a file. If you plug in a sound card or a scanner, it appears as a special file somewhere in the "/dev" directory.
  • The commands and filenames are all case sensitive. foo, Foo, FOO, fOo, and foO are all different files.
  • The commands are all shortened so you don't have to type as much. ls cp rm mv pwd man cat grep...
  • You're not a "real" Unix user until you've learnt how to use the vi text editor. (Most Linux distributions now seem to include an editor called nano which is quite straightforward to use.)
  • Unix doesn't care about file extensions like DOS and Windows do. You can name, say, an OpenOffice spreadsheet file anything you please and it will still be recognised as one. Maybe.
  • Many filenames, such as configuration files, start with a period! This causes them to be .hidden in directory .listings This is .weird
  • The slashes are the wrong way round! Paths look like /home/steve/files/foo
  • There are no drive letters like in DOS. This is handy if you want more than 26 disk drives. Instead of drive letters, drives are "mounted" on directories. Thus /usr/home/me might be on one drive while /windisk might be on another and /cdrom would of course be the cd-rom drive.
  • You can create "symbolic links" which are identical to "shortcuts" in Windows.
  • Every file has "permissions" which regulate who can access it.
  • Unix is a multi-user OS. What commands you can run and what files you can access depends on who you are logged in as. There is always a user account called "root", intended to be used by the system administrator. It has God-like powers to do absolutely anything. Even if you are the administrator of your box, it is not good practice to log in as root unless you actually want to do something that requires these special powers. This limits the damage you can do by mistake. The "su" and "sudo" commands allow you to do things "as if" you were root as long as you are in the wheel group, saving you the bother of logging out, logging in as root, doing the thing, logging out, and logging back in as a regular user.