Introduction to UNIX What Is UNIX? Why UNIX? Brief History of UNIX Early UNIX History UNIX Variants
Total Page:16
File Type:pdf, Size:1020Kb
What is UNIX? A modern computer operating system Introduction to UNIX Operating system: “a program that acts as an intermediary between a user of the computer and the computer hardware” CS 2204 Software that manages your computer’s resources (files, programs, disks, network, …) Class meeting 1 e.g. Windows, MacOS Modern: features for stability, flexibility, multiple users and programs, configurability, etc. *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright 2001-2003. (C) Doug Bowman, Virginia Tech, 2001- 2 Why UNIX? Brief history of UNIX Used in many scientific and industrial settings Ken Thompson & Dennis Richie Huge number of free and well-written originally developed the earliest software programs versions of UNIX at Bell Labs for Open-source OS internal use in 1970s Internet servers and services run on UNIX Borrowed best ideas from other Oss Largely hardware-independent Meant for programmers and computer Based on standards experts Meant to run on “mini computers” (C) Doug Bowman, Virginia Tech, 2001- 3 (C) Doug Bowman, Virginia Tech, 2001- 4 Early UNIX History UNIX variants Thompson also rewrote the operating system Two main threads of development: in high level language of his own design Berkeley software distribution (BSD) which he called B. Unix System Laboratories System V Sun: SunOS, Solaris The B language lacked many features and Ritchie decided to design a successor to B GNU: Linux (many flavors) which he called C. SGI: Irix They then rewrote UNIX in the C FreeBSD programming language to aid in portability. Hewlett-Packard: HP-UX Apple: OS X (Darwin) … (C) Doug Bowman, Virginia Tech, 2001- 5 (C) Doug Bowman, Virginia Tech, 2001- 6 1 Layers in the UNIX System UNIX Structure User Interface The kernel is the core of the UNIX Library Interface Users system, controlling the system Standard Utility Programs hardware and performing various low- (shell, editors, compilers, etc.) System Interface calls User Mode level functions. The other parts of the Standard Library (open, close read, write, etc.) UNIX system, as well as user programs, UNIX Operating System call on the kernel to perform services (process management, memory management, Kernel Mode the file system, I/O, etc.) for them. Hardware (cpu, memory, disks, terminals, etc.) (C) Doug Bowman, Virginia Tech, 2001- 7 (C) Doug Bowman, Virginia Tech, 2001- 8 UNIX Structure UNIX Structure The shell is the command interpreter Over two hundred utility programs or tools for the UNIX system. The shell accepts are supplied with the UNIX system. These user commands and is responsible for utilities (or commands) support a variety of tasks such as copying files, editing text, seeing that they are carried out. performing calculations, and developing software. This course will only attempt to introduce a limited number of these utilities or tools! (C) Doug Bowman, Virginia Tech, 2001- 9 (C) Doug Bowman, Virginia Tech, 2001- 10 Getting started Logins and passwords You must have an “account” on the UNIX machine you’re trying to use “login” is your user name (usually some variant of your real name) Your password will not echo as you type Remember good password practices (C) Doug Bowman, Virginia Tech, 2001- 11 (C) Doug Bowman, Virginia Tech, 2001- 12 2 The shell prompt Entering commands After logging in, you get some information Anytime you see a prompt, you can enter a about the system, then a shell prompt command for the shell shell: The program you use to send Some commands are a single word commands to the UNIX system who Prompts take many forms: date $ ls % Others use additional information username@hostname> cat textfile hostname # % ls -l Must beat the “Tyranny of the blank screen” (C) Doug Bowman, Virginia Tech, 2001- 13 (C) Doug Bowman, Virginia Tech, 2001- 14 Command syntax Example commands: ls (list) Commands must be entered exactly. If ls –l you make a mistake before entering, ls –a –l delete/backspace to fix it. Be careful! ls –al command options argument(s) ls –a; ls -l ls textfile Options: modify command’s execution ls folder Arguments: often filenames that tell a command what to operate on ls textfile1 textfile2 ls –al textfile (C) Doug Bowman, Virginia Tech, 2001- 15 (C) Doug Bowman, Virginia Tech, 2001- 16 If you don’t get a normal shell prompt… Ending your session A program is probably running Always log out when you are done If you see a special program prompt, try to Use the command exit (also quit the program (quit, bye, exit) sometimes logout or CTRL-d) If you see nothing, you can Note: if you are running a window Stop the program with CTRL-z (program will wait until started again) system, logging out of the shell only Interrupt the program with CTRL-c (program will ends that shell. You must also log out usually die) of the window system using a menu. (C) Doug Bowman, Virginia Tech, 2001- 17 (C) Doug Bowman, Virginia Tech, 2001- 18 3.