<<

What is ?

„ A modern Introduction to UNIX „ Operating system:

„ “a program that acts as an intermediary between a of the computer and the ” CS 2204 „ that manages your computer’tag">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 Virginia Tech. 2001-2003. () Doug Bowman, Virginia Tech, 2001- 2

Why UNIX? Brief of UNIX

„ Used in many scientific and industrial settings „ & Dennis Richie „ Huge number of free and well-written originally developed the earliest software programs versions of UNIX at for „ Open-source OS internal use in 1970s

„ servers and services run on UNIX „ Borrowed best ideas from other Oss

„ Largely hardware-independent „ Meant for and computer „ Based on standards experts

„ Meant to run on “mini

(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) he called . „ System „ Sun: SunOS, Solaris „ The B language lacked many features and Ritchie decided to design a successor to B „ GNU: (many flavors) which he called C. „ SGI: Irix

„ They then rewrote UNIX in the C „ FreeBSD 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 Interface Users system, controlling the system Standard Utility Programs hardware and performing various low- (, editors, , etc.) System Interface calls User level functions. The other parts of the Standard Library (open, close read, , etc.) UNIX system, as well as user programs, UNIX Operating on the kernel to perform services ( management, , Kernel Mode the 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

„ 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 will not as you

„ 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 „ „ Prompts take many forms: „ date „ $ „ „ % „ Others use additional information „ username@hostname> „ 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 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’ 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 (also quit the program (quit, bye, exit) sometimes logout or CTRL-d) „ If you see nothing, you can „ Note: if you are running a „ Stop the program with CTRL-z (program will until started again) system, logging out of the shell only

„ 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