Index

Share

Thursday

What Is UNIX



What Is UNIX Operating system?

InWhatthe narrowestIsUNIX?senses UNIX is a time-sharing operating system kernel: a program that controls the resources of a computer and allocates them among its users. It lets users run their programs; it controls the peripheral devices and it provides the file system that manages the long-term storage of information.

In the broader sense, it is often taken to include not only the kernel but also essential programs like compilers, editors, command languages etc.
Still more broadly, it may even include programs developed by you and other users. The UNIX system is full duplex system: the characters that you type on the keyboard are sent to the system which sends them back to the terminal to be printed on the screen.

The UNIX system primarily contains three components:

1.) The user.
2.) The Shell.

3.) The kernel.

The user means you who is using the operating system to fulfill the needs.

The shell means the interface between the user and the kernel. A user never directly talks to the kernel because it is pretty difficult to do that. Of course you would never like to talk to the kernel in assembly language or so making your job harder and time consuming. The shell does this job for you i.e. it interacts with the kernel.

LinuxIntroductionanNix operatingToRedhatsystemLinuxhas all its inherent properties from open UNIX projects. Like all other UNIX like systems it is a flavor of UNIX system and is most widely accepted worldwide at present. In only less than a decade of its development it has gained worldwide recognition in all phases of this Industry.

Linus Torvalds of the University of Helsinki in Finland originally created Linux. In the year 1991 Linux was made public. Linus made the source code freely available and encourage others to freely develop it further. The current stable version of Linux is 2.2.5-15. Much of the software is developed by Free Software Foundation’s GNU project. It is therefore free.









Amandeep Singh Kochhar      : kochhar77@yahoo.com

Nakul Goyal                               : nakul@cwsteam.com

Authors: Amandeep Singh Kochhar & Nakul Goyal


TheAdvantagesLinuxhaveOf followingLinux advantages over UNIX: 1.) Linux is free.
2.) Linux can run on as little as 150Mb of space and can run on as little as 2 Mb of Ram.

3.) Full Multitasking OS.

4.) A portion of the hard disk can be used as the Ram thus creating room for virtual Ram.

5.) It have got windows like X-Windows system. 6.) It uses standard TCP/IP protocols.

7.) The source code is freely available.



Why To Use Redhat Linux

There1.) areItisseveralbasedonreasonscurrenttostableuseRedhatKernel versionLinux:. 2.) It has got great documentation to work on.
3.) Redhat package manager is included to update the utilities or to delete the utilities.

4.) Source Code is Included.

5.) Red Hat is considered as the most secure Operating System



InterestinglyThFileSystemeverything in UNIX is a file whether it be your keyboard, your terminal, your hard disk or your Ram.

Here we will cover most of the details of using the file system- what files are, how they are represented, directories and file system hierarchy, permissions inodes and device files.
Basically a file is a sequence of bytes. Magnetic tapes, mail messages, characters typed on the keyboard, line printer output, data flowing in the pipes – each of these is just a sequence of bytes as far as the system and the programs in it are concerned.
The best way to know about files is to create a one by yourself. There are several editors in Linux which you can use to create or to edit the files. The most commonly used are PICO and VI.
We will be working with the file systems in our next lecture.


YouLggingcanlogOnontotoa asystem:Linuxsystem providing it your credentials. The credentials are your username and your password. When you log onto the system your working directory becomes /home/$Username where $Username is your user. You can work around with your files and directories in your working directory. Working in your directory does not

Amandeep Singh Kochhar      : kochhar77@yahoo.com

Nakul Goyal                               : nakul@cwsteam.com

Authors: Amandeep Singh Kochhar & Nakul Goyal

hinder the functionality of the system so you can play around with the system as and when you want.

EveryPermissions:filehas a set of permissions associated with it, which determines what one can do with the file. But there is a user superuser who can do everything with any file.

There are three types of file permissions a file can have: 1.) Read permissions. (Denoted by r, numeric value=4)
2.) Write Permissions. (Denoted by w, numeric value = 2)

3.) Executable Permissions. (Denoted by x, numeric value = 1)

Let us take an example of a file:


-rwxrw-r--
test
day
testing
The above string –rw-rw-r- -indicates the permissions.


You must note that there are 10 bits representing the permissions. The first bit tells that whether it is a file or a directory. If the fist bit is d, it denotes a directory. In the above case testing is a file. The second, third and the fourth bit denotes that there are read,write and executable permissions to the owner of the file which in this case is test. The fifth and sixth bit denotes that there are only read and write permissions to the group to which this file belongs to which in this case is day. The eighth bit denotes that others have only read permissions to the file.

Make sure that only the owner of the file can change the permissions of the file and no

one else.




So, the file is denoted by
Owner
group
Filename.

Permissions string


The Directory hierarchy:

The directory hierarchy in an orderly way starting from the top:

/bin boot dev etc lib tmp unix usr

Amandeep Singh Kochhar      : kochhar77@yahoo.com

Nakul Goyal                               : nakul@cwsteam.com

Authors: Amandeep Singh Kochhar & Nakul Goyal


These are the main directories that are in the unix system.

Bin: (binaries) It is the basic directory where the basic binary programs such as who and ed resides.

Dev: (devices) It is the directory where the device files such as printers, harddisks etc are placed.

Etc: (etcetera): It contains various administrative files such as the password files. Lib: (library) It contains the parts and libraries of the C compiler.

Tmp: (temporaries): It is a repository for short-lived files created during execution of the program.
Usr: (user): It is called the “user File system”.



TheUsingShellthe-Stheell:programs that interprets your requests to run programs- is the most important program for most UNIX users.

There are mainly the following shells:

·
ash
/bin/sh
·
ash.static
/bin/ash.static
·
bash
/bin/bash
·
bash2
/bin/bash2
·
bsh
/bin/bsh
·
csh
/bin/csh
·
ksh
/bin/ksh
·
pdksh
/usr/bin/pdksh
·
rsh
/usr/bin/rsh
·
sh
/bin/sh
·
zsh
/bin/zsh



Introduction to Some Commands:

Some commands with which you will feel working with the UNIX system are as under:

These are the very basic implementation of the commands for more options of the commands
: List the files and the directory.
Ls     : displays who is logged in to the machine.
Who : Specifies the system date.
Date

Amandeep Singh Kochhar      : kochhar77@yahoo.com

Nakul Goyal                               : nakul@cwsteam.com

Authors: Amandeep Singh Kochhar & Nakul Goyal

: echoes the typed matter onto the terminal. Echo: sends mail to the specified sender.

Mail : telnets you onto the specified machine. telnet:reads and displays the file output.
Cat; word count.

Wc : change Mode Chmod : Change ownership. Chown:move or rename the file. Mv : copy the file.
Cp: the text editor.
Vi  : Change directory.

Cd : Present working directory. Pwd : Make directory.
Mkdir: Creates the file with zero bytes. Touch:finds a pattern in a particular file.

Grep: finds a file or a directory in the unix system hierarchy. Find: finds the difference between files.
Diff


No comments:

Post a Comment

Blog Archive