Monday, December 29, 2008

download material for unix


POWER POINT presentation (ultimate) by professor Profeesor R.K.Singla (P.U.)

unix ppt

DOWNLOAD BASH SCRIPT BOOK

download here


more unix pdf:

Unix System Programming 1
Unix System Programming 2
Unix System Programming 3

various unix links



vi editor

three modes:
  1. command mode
  2. input mode
  3. ex mode

unix commands

cat filename write contents of filename to the screen
cd directory_name change current directory to directory_name
chmod mode file change permissions on file to mode.
grep phrase filename search filename for phrase and print matching lines
grep phrase read from the standard input, and print lines matching phrase
grep -v phrase print all lines not matching phrase
lpr -Pprinter_name filename Print the file filename to the printer printer_name
lpq check the printer queue
lprm job_number remove the print job numbered job_number from the print queue (to find out what job nuimber your print job is, use lpq.)
ls List files in current directory (not including files that start with a dot.
ls directory_name List files in directory_name
ls -l List files with permissions, ownership and last modified date
ls -a list all files, including files that start with a dot (like the .netscape directory)
ls -R list contents recursively, that is , list contents of subdirectories.
man command show online documentation/help about command
man -k keyword show commands related to keyword. Handy if you need help, but don't know the name of the command
mkdir directory_name Makes a directory called directory_name
pwd "print working directory", ie says what directory you are in
rm filename removes filename
rm -f f is for "force". With this option, files are removed without confirmation.
rm -r directory_name recursively delete directory_name and its contents.
rmdir directory_name removes a directory called directory_name. Only works on empty directories. to remove a nonempty directory, see rm -rf
telnet hostname connect to the machine called hostname
wc filename print the number of lines, words, and characters in filename. If No filename is given, stdin is used.

files in unix

1) ordianary files: files created to store text
2)directories :
it is special kind of file that stores information of other files
3) special files:
used to represent real physical devices . eg. Printer , tape, terminal(moniter,screen)
two types: (a) chaaracter IO (on screen)
(b) block IO (in hardisk)
these files are found in directory /dev
4) pipe:
pipe is also called a file (special type)


FILE NAMES:
  • it is recomended that not to use special characters in filename
  • file may or may not have any extension
  • in a directory two files cannot have same name
  • there are some file name which you cannot use they are reserverd e.g.
(i) / is reserved for root directory
(ii) . is reserved for current directory
  • hidden file name start with a dot ( . )

basics

1) Kernal
2) Shell
3) Utilites

Kernal-

(i) take care of your Operating system
(ii) its a memory resident program(available in memory all the time)
(iii) loaded at boot time
(iv)manages entire resources of your system.these resources available to each user as a unit
(v) also provide service to user application, i.e. voice manager , Process ,Schedular


Functions of kernal:

(i) schedules work done by cpu(work of user is carried out as early as possible).as FCFS (first come first serve)
(ii) Transfer data from one part of machine to another
(iii) Interpret and execute instructions from shell
(iv)Enforce file access permissions

SHELL:

(i) Command line interpretor
(ii ) the moment you logged in you got placed in a shell program

shell prompt ----> $

(iii) shell moves your request to kernal
(iv) shell checks list of valid commands
(v) donot put burden on kernal
(vi) shell takes command from user and pass on to OS kernal to execute it

Types of Shells:

(i) Bsh -> Bourne shell
(ii) Bash -> Bourne Again Shell
(iii)Tcsh -> turbo c shell
(iv) Csh -> C shell
(v) Ksh -> Korn shell