1 / 145

INTRODUCTION TO UNIX . D.S Assoc.prof M.Tech Incharge KIET

INTRODUCTION TO UNIX . D.S Assoc.prof M.Tech Incharge KIET. Unix introduction. Unix was introduced to the world by bell labs in the late 1970. From the beginning it was intended to be a powerful operation system that could be ported to a variety of hardware environments.

woody
Télécharger la présentation

INTRODUCTION TO UNIX . D.S Assoc.prof M.Tech Incharge KIET

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. INTRODUCTION TO UNIX.D.SAssoc.profM.TechInchargeKIET

  2. Unix introduction • Unix was introduced to the world by bell labs in the late 1970. • From the beginning it was intended to be a powerful operation system that could be ported to a variety of hardware environments. • The bell laboratories contribution in 19765-1970 AT and T worked on a joint project called MULTICS(multiplexed information computer systems) which intend to develop multi user operating system as the progress was not satisfied.

  3. . • On The basic of the idea implied while working on the3 MULTICS, Ken Thomson , a researched started working on different projects. • He came across an abounded PDP7 machine on which he and Dennis Richie develop an operating system called UNICS (Unified information and computing system) during the latter part of 1969 in assembling language in PDP.7 and do it is not portable. so achieve portability • ken Thomson consider implementing the system in a higher level language. He worked on developing a higher level language c in 1973 • At The same time many researches in ‘AT & T’ Bell laboratories interested in the unix project around 1970 UNICS become UNIX.

  4. . • The results of the research and the developing more at the bell laboratories where I published in the form of UNIX programmers manual in the late 1971. • Actually 95% of this unix system was written C language and the remaining 5% is in assembly language. • The details of the unix implementation in ‘c’ was made public through a paper publication in 1974. this paper was quit poplars and its authors ken Thomson and Dennis retches' later awards with the prestigious ACM Tuning awards

  5. . • Features of UNIX OS: • MALTIUSER CAPABILITY • Time sharing • Command interpreter • Portability • Multitasking and back ground processing • Hierarchical file system • Simple command structure • File security and protection • Communication • System administration • Job accounting • Tools and utility • Shell and shell programming

  6. . 14. Availability of rdbms 15. Graphics 1.Multiuser capability: the unix multiuser system user can give different programs they can share data base like one user can enter the date , one user can update the data, one user can generate the reports at the same time. 2.Time sharing: Unix operator on the prepares of time sharing executed by the scheduler of users program is loaded in to the memory from the disk and scheduler provides and time like for each user.

  7. . 6. Hierarchical file system: The Unix provides an excellent multiple file system. The directory in Unix can have sub directories ad files co-existing. 7. Simply command system: The Unix system commands or user friendly commands are entered in lower case. • The commands are easy to remember, and an ordinary user has to know and only 15 to 20 commands. • The command such as ls, cut, pwd,l pr, chmod, mkdir,r mdir, rm, cp, mv a.re used to handle the file and directories. 8. File security and protection : Unix provides production to users files and directories from unauthorized user use in the particular file . • Login and passed word are provided by Unix and prevents unauthorized people from going access to the system it self.

  8. 9. communication: Unix as a verity of communication software bundles, a user can communicate from Unix environment to users, under Unix provides communication capabilities form a computer in one city or country to another authorized users though telephone lines, microwave links and satellite communication.10. System administration: Unix provides excellent features for monitoring and controlling the use of multiuser system . .System administration relates to the various activities needed to controlled .11. Job Accounting: Unix also provides for maintenance of job accounting of various users of the system in terms of monitoring the CPU time used, lines printed, and utilized, terminal log on time …etc

  9. . 12.Tools and Utilizing: there are 100’s of tools available in Unix and the no’s are their even, user can create tools of their own as per their convince. 13. Shell and shell programming: the command interpreter of Unix is called shell . There are how types of popular shell’s available, in Unix one is Bourn shell and other is ‘c’ shell. 14. Availability of RDBMS: The RDBMS function is under multiuser system enable data addition modification deletion and access simultaneously by multiple users in the system. 15. Graphic: powerful graphics work stations used for engineering design and 3d graphics prepare Unix as the operating system.

  10. . STRUCTURE OF UNIX

  11. KERNEL: Kernel is the heart of Unix system. This kernel is relatively a small pieces of code that is embedded on the hardware.>Actually it is a collection of programs that are mostly written In ‘c’.>Every Unix system has a kernel that gets automatically lorded on to the memory as soon as the system is booted.>As the kernel sits on the hardware, it can directly communicate with hardware.>In fact the kernel is the only component that can communicate witch the hardware directly.>It is the kernel that manages all the system resources like memory and input output devices, allocates time between user and process in the case f multiuser environment decides process manages inter process communication and perform many other tasks

  12. .Shell: The shell is the part of Unix that is most visible the user it receives and interpreters the commends entered by the user.> shell Is a program that sits on the kernel and acts as an agent or interface between the user and kernel and hence the hardware.>shell presents a command line for prompt($,%) , at which the user can type in any unix command after accepting the command, the shell generates a readly executable simply command line by parsing it.> the shell as certain programing capabilities of its own.>the shell programming can be written generally shell script. C shell born shell and korn shell

  13. Born-shell: this is the most common shell available on Unix system and the first manger shell this shell is widely used it has named “Stephen Bourne” at AT and T bell laboratories.C-shell: the c-shell was developed by “Bill joy”, the shell at part of the BSD release it is call c-shell because its syntax and usage is very similarly to the c- programming languageKORN-shell: this shell was developed by devidkorn at ‘AT’ and ‘T’ Bell laboratories. Basically it is vuilt on the born cell, it also incorporates certain features of c-shell

  14. VI EDITOR .

  15. . • The vi editor is available on almost all Unix systems. vi can be used from any type of terminal because it does not depend on arrow keys and function keys--it uses the standard alphabetic keys for commands. • vi (pronounced "vee-eye") is short for "vi"sual editor. It displays a window into the file being edited that shows 24 lines of text. vi is a text editor, not a "what you see is what you get" word processor. vi lets you add, change, and delete text, but does not provide such formatting capabilities as centering lines or indenting paragraphs. • This help note explains the basics of vi: • opening and closing a file • moving around in a file • elementary editing

  16. . • What is vi? • The default editor that comes with the UNIX operating system is called vi (visual editor). [Alternate editors for UNIX environments include pico and emacs, a product of GNU.] • The UNIX vi editor is a full screen editor and has two modes of operation: • Command mode commands which cause action to be taken on the file, and • Insert mode in which entered text is inserted into the file. • In the command mode, every character typed is a command that does something to the text file being edited; a character typed in the command mode may even cause the vi editor to enter the insert mode. In the insert mode, every character typed is added to the text in the file; pressing the <Esc> (Escape) key turns off the Insert mode. • While there are a number of vi commands, just a handful of these is usually sufficient for beginning vi users.

  17. . The Following commands are mostly used in vi

  18. The Following commands are mostly used in vi h – backspace→ cursor moves to leftl (or) spacebar → moves cursor right5l → moves 5 characters to rightk → moves cursor up10k → moves 10 lines upj → moves cursor downscrolling:contrl+f → scrolls full page forward5 contrl+f→ scrolls five full pages forwardcontl+b→ scrolls full page backcontl+d→ half page forwardcontl+u→ half page backward

  19. Word navigation:b→ moves back to begin of word 4b → moves back 4words to begine → moves forward to end of wordw → moves forward 8w → moves forward to beginning of 8 wordso (or) | → moves to beginning of lines30| → moves to column 30^ → moves to first word in line$ → moves to end of line1G → moves to beginning of file40 → moves to line 40G → moves to end of fileX, dd→ deleting optionsx → deletes a single character4x → delete 4 charactersJ → joining lines

  20. dw → deletes one word3dw → deletes 3 wordsdG → deletes form current curser position to end of filech → change previous character4ch → change previous 4 character4c2h → change previous 8 characterc2j → change current line and text two linescw → change form current character to next wordc) → change form cursor to beginning of next sentencec{→ change backward to beginning of paragraph cc → change current liners } → replace the current character ,.m

  21. Line mode:-:w→ save file and remain in editing mode: x → save file and exit editing mode:wq→ save and exit:w n2 w. pl → like save as in :w! n2wpl → as above but over write existing:e! → this option is used to loads lost saved addition of current file.

  22. ScreenManipulation: The following commands allow the vi editor screen (or window) to move up or down several lines and to be refreshed. ^f move forward one screen^b move backward one screen^d move down (forward) one half screen^u move up (back) one half screen^l redraws the screen^r redraws the screen, removing deleted lines

  23. Cursor Movement:h move left (backspace)j move downk move upl move right (spacebar).

  24. Deleting Text:x :delete single character under cursorNx :delete N characters, starting with character under cursordw :delete the single word beginning with character under cursordNw :delete N words beginning with character under cursor;   e.g., d5w deletes 5 wordsD :delete the remainder of the line, starting with current cursor position* dd :delete entire current lineNddordNd :delete N lines, beginning with the current line;   e.g., 5dd deletes 5 lines

  25. File handling utilities:pwd, cat, cc, ls, mv, cp, touch, unlink, mkdir, rmdir, cd, ln, od, gzip, more, mv, rm, script, chmod, chgrp, man, chgroup. Echo,printfprocess utilities: ps, kill, at, nice, who, w, ulimit.Text processing utilities: head, tail, nl, sort, uniq, cut, paste, tr, join, tee, comm, cmp,diff, find, grep, awk.Networking utilities:ftp, rlogin, telnet, finger, arp • .

  26. Disk utilities:df, du, mount, umount,Back up utilities:cpio, tar

  27. File handling utilities: 1. cc :- This command is used to c compiler or it compiles the code of the fileSyntax: cc [option] file nameoption : option –f → no floating point require -fp→ hardware floating point usingExample:cc f1.c (compilation )./a.out←Description: when you invoke Gcc, it normally does preprocessor compilation, assembly and linking.

  28. Man command:name: man-an interface to the on-line reference manualssyntax: man [option] key wordDescription: man is the system’s manual pager. Each page argument given to man is normally the name of a program, utility or function. The manual page associated with each of these arguments is then found and displayed.Exicutions:$ man rmdir .

  29. echo command: name: echo- display a line of textsyntax: echo[option]..[string]Description: -n → do not output the trailing newline-e → enable interpretation of backslash escapes-E → disable interpretation of backslash escapes.Exicutions: $ echo haimca student A. Haimca student$echo haimca students >f1$cat f1A. Haimca students .2

  30. 3.PRINTF COMMAND: Fermat and print datasyntax: printf FORMAT[ARGUMENT]printf [option].Description: The printf command is an alternative to the echo command. In addition to displaying simple massage, it can also format the output.The printf command does not insert a new line(\n) unless it is used explicitly. It accepts all escape sequences like \n, \c, \a, \t used by echo.Exicutions:Q. $printfhaiA. Hai$printfQ. $ printfhaimcaA hai $printfQ $ printf ‘haimca’A haimca $printf

  31. 4.SCRIPT Command:NAME: script- make typescript of terminal sessionSYNTAX: script [-option] argument.DESCRIPTION: Script makes a typescript of everything printed on your terminal. It is useful for students who need a hardcopy record of an interactive session as proof of an assignment, as the typescript file can be printed out later with LPR() . Executions: Q $scriptA Script started, file is typescripotQ $ dateA Fri oct 1 09:32:17 IST 2010Q cat f1A haihello$cat typescriptscript started on Friday 01 dec 2013 09:31:45 am IST

  32. . 5.Passaword: Passwd-change user password Syntax: passwd [options][LOGIN] Description: The Passwd command changes passwords for user accounts. A normal user may only change the password for his/her own account, while the super user may change the password for any account. Passwd also changes account information, such as the full name of the user, the user’s login shell, or his/her password expiry date and interval. Password changes: • The user is first prompted for his/her old password, if one is present. This password is then encrypted and compared against the stored password. The user has only one chance to enter the correct password. The super user is permitted to bypass this step so that forgotten passwords may be changed.

  33. . Exicutions: • Enter wrong password • $ passwd← Change password for ds (current) UNIX password Ds Passwd: Authentication token manipulation error Passwd: password unchanged • $ passwd Changing password for ds (current) UNIX password: Srinivaskiet Enter new UNIX password: Kiet Retype new UNIX PASSWORD: Kiet Bad: new password is too simple Passwd: Authentication token manipulation error Passwd: password unchanged

  34. Change password:$ passwdchanging password for rajesh(current) UNIX password:srinivaskietenter new UNIX password:kiet123Retype new UNIX password:kiet123passwd: password updated successfully

  35. 6.Uname commenduname-print system informationsyntax : uname [option]description:print certain system information. With no option, same as –s-a-allprint all information, in the following order, except omit –p and –I if unknown:-s →kernel-name-print the kernel name-n- → node name- print the network node hostname-r- → kernel release- print the kernel version-m → machine- print the machine hardware name-p- → processor- print the processor type or “unknown- I, hard ware platform-o → operating system –print the operating system

  36. Executions: $ unameLinux$uname –aLinux kiet-laptop 2.6.28-11generic#42-Ubuntu SMP Fri Apr 17 01:57:59 UTC 2009 i686 GNU/Linux$ uname –nkiet laptop$uname –sLinux$ uname –r2.6.28-11-GENERIC$uname -v#42-Ubuntu SMP Fri Apr 17 01:57:59 UTC 2009$ uname –mi686$ uname –punknown

  37. 7.Stty command:stty- change and print terminal line settingssyntax: stty[-F DEVICE][--file=DEVICE][SETTING]stty[-F DEVICE][--File=device][-a|--all]stty[-F DEVICE][--file=DEVICE][-g|--save]Description: print or change terminal characteristics.-a → all print all current settings in human-readable form-g–→saveprint all current settings in a stty- readable formexicutions:$stty speed 38400baud; line=0$stty –a$stty -g

  38. . 8.Pwd command: This command is used to print name of current/working directory Syntax: pwd [option][arguments] Description: The command used to determine the current directory is print working directory (pwd). It has no options and no attributes. When executed, it prints the absolute path name for the current directory. Executions: $pwd /home/kietmca

  39. . 9.Cat command: concatenate files and print on the standard output Syntax: cat [option][file] Description: concatenate File(s), or standard input, to standard output. -e → equivalent to –Ve -E → show ends-Display$ at end of each line -n → number all output lines -s → squeeze-blank-suppress repeated empty output lines -t → equivalent to -vT -T → display TAB characters as ^lx

  40. . • Executions: • $ cat>a Hai Welcome to mca • $cat a hai Welcome to mca • $cat>>a Kietmca • $cat a Hai welcome to mca kietmca

  41. . • $ cat –e a Hai$ Welcomemca$ Kietmca$ • $cat –n a 1 hai 2 welcomemca 3kietmca 10.Cc command cc- this command is used to c and c++ compiler(gcc) Syntax: cc[option] filename Description: when you invoke GCC, it normally does preprocessing , compilation, assembly and linking. The” overall options” allow you to stop this process at an intermediate stage. For example, the –c option says not to run the linker. Then the output consists of object files output by the assembler.

  42. . EXECUTIONS: • $cc hello.c $ ./a.out 11.Ls command: This command is used to display the list of directory contents Syntax: ls[option]..[file] Description: • List information about the Files( the current directory by default). Sort entries alphabetically . • mandatory arguments to long options are mandatory for short options too. -l → use a long listing format -a- → all-do not ignore entries starting with

  43. . -r → reverse- reverse order while sorting -t → sort by modification time -i → print the index number of each file -p → append/indicator to directories list subdirectories recursively Executions: $ls F1 f2 f3 f4 f5 dir1 $ls-l -rwr r-x-wx 1 kietmca kiet 54 2013 -17-12 12:50 f1 $ls –ld $ls –d $ls –n $ls –t Kietmca f1 f2 f3 f4

  44. . 12. mv command: This command is used to move (rename)files Syntax: mv[option].. . Source dest mv[ option]…source…directory mv[option]… -t directory source Description: This command is used to move either an individual file, a list of files, or a directory. After a move, the old file name is gone and the new file name is found at the destination. This is the difference between a move and a copy after a copy, the file is physically duplicated; it exists in two places. The move format appears the first argument is the name of the file to be moved. The second argument is its destination or , in the case of a rename, its new name.

  45. . Executions: $ mv ab $cat b Hai how are u $cat c Kiet $mv – I bc $ mv –f a dir $ ls –l dir total 0 rwr r-x-wx 1 kietmca kiet 54 2013 -17-12 12:50 f1

  46. 13.Cp command This command is used to copy files and directories Syntax: cp[option].. . Source dest cp[ option]…source…directory cp [option]… -t directory source Description: The copy (cp) utility creates a duplicate of a file, or a directory. If the source is a file, the new file contains an exact copy of the data in the source file. If the source is a directory, all of the files in the directory are copied to the destination, which must be a directory. If the destination file already exists, its contents are replaced by the source file contents. The cp command copies both text and binary files.

  47. . • Exicutions: • $ ls F1 f2 • $cp f1 f2 • $cat a Hai How are u • $cat b Hai How are u

  48. 14. Touch: This command is used to change file timestamps Sysntax touch [option].. File Description: Update the access and modification times of each FILE to the current time. Afile argument that does not exist is created empty. A file argument string of –is handled specially and causes touch to change the times of the file associated with standard output -a – change only the access time -c- do not create any files -r use this files times instead of current time Exicutions: $ ls-l $ touch a b

  49. 15.Ln command This command is used to links between files Syntax : ln[option]..target link_name (1st form ln[option]…TARGET (2nd form) ln[option].. TARGET.. DIRECTORY (3rd form) Description: Link has three options: symbolic, interactive, and force Symbolic: the default link type is hard. To create a symbolic link, the symbolic option(-s) is used. Interactive: if the destination file already exists, its contents are destroyed unless we request to be warned by using the interactive flag(-i). When the interactive flag is on link asks if we want to destroy the existing file. This is similar to the message we get when the permissions don’t allow us to write the file.

More Related