Unix for starters

Fundamentals of Operating systems Other concepts
Unix commands Back to Unix admin page

The fundamentals of Unix and Computers

System V Unix operating systems was developed by AT&T bell labs and it is the most widely used Unix operating systems. An operating system is that piece of software which lets you interact with hardware in your computer. For example, when to call CPU, when to store in Memory, when to read from Disk , how to connect to outside world is all being done on any Operating systems in any computer at all the time, oblivious to the user. Then this operating systems is put in a package before selling to us, just like when you buy chocolates. The package around which this operating systems is wrapped is called User Interface in computing terminology. Some developers like Microsoft spend more time on developing this user interface than the real operating systems, like Windows 95, others like Sun solaris had spend more time on reliability and strength of the operating systems rather then how user interacts with it. That's the big difference between Unix and Windows 95 (and all the other microsoft products). Unix is more powerful, more reliable, can do much more work, much faster and you do not need to reboot your computer everyday. Only problem is that many people get put off by the command line user interface. But things are changing now and even unix has its own version of X windows. Learning different command on Unix is quite an experience. Unix operating systems uses many different user interfaces depending upon the user, different command line interfaces are called Shells, you can use Ksh (korn shell), Bash, (bourne Again Shell), csh (C shell), etc.

The core of unix is called kernel. Kernel interacts with hardware, software and user interface (i.e. Shell). When you enter a command to add two numbers, kernel converts the ascii english like command to the binary language of central processing unit and then pass these binary bits of 1's and 0's to cpu byte by byte which then processes and give back the answer to kernel and kernel sends it out to standard output (screen) after converting them back to decimal number notation which we all use.

In this document all the commands that appear in greenish blue color you can type and use in your Unix session.

The Basics

How do I login to Unix system?

You need to have an account created by unix administrator for that particular system. For example if you want to login to unix systems named punjab1., open up a new session to punjab1 and at prompt enter your user name and password as supplied by Administrator.

What do I do after login?

Once logged in, you will see a shell prompt, actually a blank screen with on blinking cursor, that means you are ready to enter your commands. Here you can use These basic unix commands. For more information about that command you can use online help by typing man man. $ sign means shell prompt so you do not need to enter $.

back to top
Back to main page

Some common problems

One of the first common problem is incorrect TERM variable. To make sure that your terminal is set to correct emulation check your emulation by cal command which displays calendar for current month. Type cal at command line.

December 1997
 S  M Tu  W Th  F  S
    1  2  3  4  5  6
 7  8  9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31 

If you did not see nice and formatted like above then probably you need to set your terminal emulation.

To find out what your terminal is set to.

$echo $TERM

(this is what you should get back, vt100 works well with ibm PCs)

To see what shell you are using echo $SHELL

is what you will get if using korn shell,
if using c shell. You default login files if you are using korn shell are .profile and .kshrc and for c shell are .login and .cshrc. You can edit these files to put any additional variables you like to set when logging in .

To make your backspace key an erase key.

stty erase backspace key

To set terminal emulation to vt100 if using ksh

export TERM=vt100

if using csh

setenv TERM vt100

Other conecpts

What are files?

The bits and bytes of data represented in electronic flip and flops are files. For example, an ascii character of A is represented by 41H or 0100 0001. Which is interpreted by CPU in the time period as one low one high one low one low one low one low one low one high. So here code for A which is 41 (in Hex) is actually one byte, since a 0 or 1 is one bit and one byte equals 8 bits.

Two types of files exist in computing world, Ascii and Binary. ASCII is portable across many different operating systems (or platforms as some people call) it is a standard and its full form is American Standard Code for Information Interchange. Binary files depends upon the application on which it is used. For example this document you are reading is an ASCII file while the pictures you are seeing are binary files cause pictures depends upon few formats like gif or jpg which can be interpreted by the browser (Netscape, IE Explorer). So while transferring files from one system to another, using binary mode is safer, since bit by bit is transferred. As you are reading this document which is called index.html it is using ASCII characters with references to binary picture files and other html ASCII files here and there.

Then there are permissions on each of these files which are divided into your permissions, your group's permissions, rest of world permissions, and extra permissions (sticky bit, suid bit, etc).
back to top
Back to main page

I am going to create a new file using cal command which displays calendar and instead of seeing it on the screen I will put the output in a file called cal.txt using redirection > symbol.

cal > cal.txt

Now to see this file and permissions on it I will use ls command with -la option.

ls -la cal.txt

-rw-rw-rw- 1 ssb dxidev 135 Dec 3 16:14 cal.txt

In this line above I have -rw-rw-rw- meaning respectively that owner can read and write file, member of the owner's group can read and write this file and anyone else connected to this system can read and write this file., next ssb is owner of this file dxidev is the group of this file, there are 135 bytes in this file, this file was created on December 3 at time16:14 and at the end there is name of this file. Learn to read these permissions in binary, like this for example Decimal 644 which is 110 100 100 in binary meand rw-r--r-- or user can read,write this file, group can read only, everyone else can read only. Similarly, if permissions are 755 or 111 101 101 that means rwxr-xr-x or user can read, write and execute, group can read and execute, everyone else can read and execute. All directories have d in front of permissions. So if you don't want anyone to see your files or to do anything with it use chmod command and make permissions so that only you can read and write to that file, i.e. chmod 600 filename.

For more information about how to change permissions and ownership of files read administration file system section. back to top of this page
back to other concepts

Top of page
fundamentals of unix