Presentation is loading. Please wait.

Presentation is loading. Please wait.

Learing outcomes Introduction to Unix system Unix commands.

Similar presentations

Presentation on theme: "Learing outcomes Introduction to Unix system Unix commands."— Presentation transcript:


2 Learing outcomes Introduction to Unix system Unix commands

3 What is a UNIX? UNIX is an operating system An operating system is the program that controls all the other parts of a computer system, both the hardware and software.

4 What is LINUX LINUX is a free UNIX-type operating system originally created by Linus Torlvads with the assistance of developers around the world. The source code for Linux is freely available to everyone. The commands of linux are similar to unix.

5 Features of UNIX UNIX is a multi-user, multi-tasking operating system. Multi-users may have multiple tasks running sumiltaneously. This is different than PC operating system UNIX is a machine independent operating system. Designed from the beginning to be independent of the computer hardware

6 Introduction unix Developed at Bell Laboratories in the late 1960s by Dennis Ritchie and Ken Thompson Shell is simply a program that reads in the commands you type and converts them into a form that is more readily understandable by the UNIX system

7 Introduction (continue.) Shell includes some fundamental programming constructs that let you make decisions, loop, and store values in variables Bourne shell was written by Stephen Bourne in Bell laboratories Bourne shell is the standard shell

8 UNIX System The UNIX system is logically divided into two pieces: Kernel Utilities

9 UNIX System (continue.) Kernel is the heart of the UNIX system and resides in the computer s memory. It allocates time and memory to programs and handle filestore and comunications Utilities disks UNIX system kernel Memory

10 UNIX System (continue.) Utility resides on the computer s disk and are only brought into memory as requested. Virtually every command under UNIX is a utility Shell is a utility program loaded into memory for execution whenever you log into the system

11 Logging in a UNIX system Terminal is connected to a UNIX system through Direct wire Modem LAN After you connect the UNIX system a login: message appears

12 Logging in a UNIX system (continue.) UNIX SYSTEM KERNEL getty login:

13 Logging in a UNIX system (continue.) init is the UNIX system init automatically starts up a getty program on each terminal port whenever the system is allowing users to log in After getty displays the message login: and some types the usernames followed by RETURN, it starts up a program called login to finish the process of logging in. Then getty disappears /etc/passwd file has one line per user

14 Logging in a UNIX system (continue.) UNIX SYSTEM KERNEL login getty login: Skan password: login:

15 Logging in a UNIX system (continue.) After login begins execution, Password: message appears User types the password and hits RETURN The user name and the password will be checked against the corresponding entry in the file /etc/passwd

16 Logging in a UNIX system (continue.) Every line has seven fields separated by :. The fields are : 1. Login name 2. Password (encrypted form). 3. User ID 4. Group ID 5. User information which could be First and Last name, etc … 6. Home directory 7. Program to start up when user logs in. Usually a shell program

17 Logging in a UNIX system (continue.) Example $ cat /etc/passwd root:x:0:1:Super-User:/:/sbin/sh daemon:x:1:1::/: bin:x:2:2::/usr/bin: sys:x:3:3::/: adm:x:4:4:Admin:/var/adm: lp:x:71:8:Line Printer Admin:/usr/spool/lp: uucp:x:5:5:uucp Admin:/usr/lib/uucp: nuucp:x:9:9:uucp Admin:/var/spool/uucppublic:/usr/lib/uucp/uucico listen:x:37:4:Network Admin:/usr/net/nls: nobody:x:60001:60001:Nobody:/: noaccess:x:60002:60002:No Access User:/: nobody4:x:65534:65534:SunOS 4.x Nobody:/: oracle:*:101:67:DBA Account:/export/home/oracle:/bin/csh webuser:*:102:102:Web User:/export/home/webuser:/bin/csh abuzneid:x:103:100:Abdelshakour Abuzneid:/home/abuzneid:/sbin/csh $

18 Logging in a UNIX system (continue.) UNIX SYSTEM KERNEL /bin/sh /usr/lbin/ksh /usr/data/bin /dat_entry login: Skan password: $ login: login: Med password: $ login: slim password: $

19 After Shell starts When shell starts up, it displays a command prompt: $ in Bourne shell and Korn shell % in C shell Shell goes to sleep after every command or program followed by RETUN until the program has finished This copied program is called a process

20 init Login cycle init getty login init sh

21 Login cycle (continue.) Shell nameUtility Developed by Bourne shellsh Stephen Bourne Korn shellkshDavid Korn C shellcshBill Joy

22 Responsibilities of Shell Program Execution Variable and File Name Substitution I/O Redirection Pipeline Hookup Environment Control Interpreted Programming Language

23 Program Execution Format: program-name arguments The shell scans the command line and determines the name of the program to be executed and what argument to pass to the program Multiple occurrences of white spaces characters are simple learned

24 Program Execution (continue.) $ mv oldfile newfile $ echo Smile, you are in Bridgeport City Smile, you are in Bridgeport City $ oldfile newfile mv arguments Smile, you are in Bridgeport City echo arguments

25 Program Execution (continue.) Shell has some built_in commands which execute them directly without searching the disk cd, pwd and echo are built_in commands

26 Variables and File Name Substitution assign values to variables $ list=ls $ ls Carthage Damas $ $list Carthage Damas file name substitution on the command line * ? []

27 Variables and File Name Substitution (continue.) Examples $ ls Documents Memos mail personal $

28 Documents Memos mail personal echo arguments Variables and File Name Substitution (continue.) $ echo * Documents Memos mail personal $

29 Variables and File Name Substitution (continue.) $ ls Documents mail Documents: a.doc c.doc p1 p11 mail: p1 p2 $

30 Input/Output Redirection <InputInput From a file <<Here Document Read From Shell Script >OutputDirect to a File >>OutputAppend to a File Examples $ wc -l list 2 list $ wc -l < list 2 $

31 Input/Output Redirection (continue.) -l users wc arguments -l wc arguments

32 Input/Output Redirection (continue.) In the first command line, two arguments where passed to wc (word count) utility: -l and users In the second command line, one argument is passed to wc utility: -l. This gives the indication that the number of lines appearing on standard input is to count

33 Pipeline Hookup Connects to commands Pipe characters: | ^ Connects the standard output from the command preceding | to the standard input of the one following the |

34 Pipeline Hookup (continue.) Example: $ who | wc -l Counts the number of users login to the system by connecting the standard output of who to the standard output for wc

35 Basic Unix commands cat file Concatenate or type out a file cat file1 file2... Type out a number of files cd directory1Change current directory to directory1 cd /usr/binChange current directory to /usr/bin cd Change back to your home directory clearClear the current screen cp file1 file2Copy file1 to file2 cp file1 file2... dir Copy a number of files to a directory ls List the files in the current directory ls /usr/binList the files in the /usr/bin directory lpr file1Print file1 out lpr file1 file2...Print a number of files out more fileLook at the content of a file with paging, use q to get out mkdir directoryCreate a directory mv file1 file2Move file1 to file2, like rename. mv file1 file2... dirMove a number of files into a directory mv dir1 dir2Move or rename a directory

36 Basic Unix commands (continue) rm file Remove a file rm file1 file2.. Remove a number of files rm -r directory Remove a directory include the sub-directory rmdir directory Remove a directory

37 DOS CommandUnix CommandDescriptions CDcdChange directory CHKDSK duDisk usage CLSclearClear the current screen COPYcpCopying files DELrmRemoving files or directories DIRlsFile listing of directories MDmkdirCreate a directory MOREmoreType out a file with paging PRINTlprPrint out a file RDrmdirRemove a directory RENAME mvMoving files around TYPEcatType out files Unix commands vs DoS

38 Who, When, Why, What and Where? man cpDisplay on-line manual for the cp command man -k keywordDisplay manual help file related to the keyword passwdChange your login password pwdDisplay the path name of where you are uptimeTell you how long the machine has been up and running usersTell you who is logging in whoTell you who is logging-in in detail wTell you who is logging in and doing what! whoamiShow you the owner of this account finger userFind out the personal information of a user finger nameTry to find the persons info. by his/her name finger email-addressTry to find the persons info across the network write userWrite a message on somebodys screen talk userTalk to the person logging in the same system with you talk email-addressTalk to somebody logging in the network dateDisplay todays time and date cal yearDisplay the calendar of the specified year (e.g. 1997)


Download ppt "Learing outcomes Introduction to Unix system Unix commands."

Similar presentations

Ads by Google