Unix Introduction Getting started with the Unix Operating System What is an Operating System? A computer Operating System, or “OS” What is a computer operating system? Where? What does an OS provide? Insulation from hardware Allocation of resources Utility Functions (often blurring the line between OS and applications) The problem There are numerous past, present, and future storage technologies Each of these requires unique procedures for getting data to and from the device. But, it is unreasonable to expect each application to understand each device. The solution The OS provides simple "abstract devices” for storage: Random access (disks, solid state) Sequential access (tapes) Applications talk to the abstract devices, the OS translates and talks to the actual devices. The OS provides a layer of insulation from these details. Beyond storage Insulation roles of the OS extends to most aspects of computer hardware, including User interface devices Network and communications Memory Expansion busses … OS-Hardware pairing OS is necessarily closely tied to particular hardware. OS used to always be supplied by the hardware vendor. What does an OS provide? Insulation from hardware Allocation of resources Utility About that “disk” abstraction… The disk abstraction represents a disk as quantity of storage. An application is insulated from the hardware details of exactly how the data are stored. An application can read or write from any location in that quantity of storage. The problem The disk abstraction provides no structure for data stored in the disk. If multiple applications want to use the same disk, they must agree on a way to structure data. The disk abstraction is a like file cabinet without file folders. The solution An OS provides higher level abstractions than just devices. For data storage: File — a named container for data Directory — a named container for files Files and directories An application manages data inside a file however it likes. Things an application can do with a file: create, open, seek, read, write, close, rename, remove. The OS manages the storage of files on the disk for all applications. Beyond storage The OS arbitrates application access to all system resources. CPUs Memory Input and output devices … What does an OS provide? Insulation from hardware Allocation of resources Utility Gray areas at the edge Insulation from hardware and allocation of resources are core OS features, but alone don’t make for a useful system. This does not provide for a user interface. Practicality leads real-world OS's beyond the core functions. The boundary between operating systems and applications is open to interpretation. What does an OS provide? Insulation from hardware Allocation of resources Utility Layers of software OS and other software are often depicted as functional layers. Software in one layer can only use services provided by the immediately lower layer. Graphic from The Design of the Unix operating System by Maurice J. Bach, Prentice-Hall, 1986 Introduction to Unix Logging In • Unix is a multi-user operating system. If you want to use its resources, you must first identify yourself to the system by logging in. This is called authentication. Logging In ! The server we will be using for most of this class is accessible through the network by the name of iris. We use the full DNS name to distinguish it from any other server that may be named "iris". More on DNS later. iris.ils.indiana.edu Logging In • You can login to a Unix system from any location in the world using any client that supports the network protocol "ssh". The secure shell (ssh) is a protocol that is used to create a secure channel over an insecure network. • Invoking the ssh command will knock on a particular server door which in turn will prompt for a username and password. Once you successfully authenticate you have access to the system resources via this secure channel. Logging In Practice • We will now use ssh to connect to our host, iris. • Every modern operating system (Mac/Linux/Windows) has the capability of running a ssh client. Linux and Mac OS X are just different distributions of Unix and therefore have native support for this type of connectivity. Windows users can download one of the many free ssh clients. For OSX/Linux users, just launch the "Terminal" application and use the ssh command. Logging In Practice • In a Windows environment, launch your ssh client and enter the DNS name of our server: iris.ils.indiana.edu • In an OS X or Linux environment, once you launch the terminal application type the command line below. $ ssh [email protected] Kerberos Authentication • You will be asked for your kerberos password, which should be the same password you used to log in at this lab. • Kerberos is used campus-wide as a secure way to authenticate across an insecure network. You and the computer you connect to prove that you are who you say you are without actually sending passwords across the network. Logging In • Once successfully logged in, a Unix system typically tells you when you logged in last and from where, shows you any implemented disk quota, gives you some arbitrary text written by the system administrator, provides you with a command shell prompt, and then waits for your commands. Logging In • Example: Last login: Mon Aug 4 15:20:54 2008 from chionofuji.ils.indiana.edu Disk quotas for stevecox (uid 2238): Filesystem usage quota limit timeleft files quota limit timeleft |-----------------------------------------------------------------| | This system is for the use of authorized users only. | | Individuals using this computer system without authority, or in | | excess of their authority, are subject to having all of their | | activities on this system monitored and recorded by system | | personnel. | | | | In the course of monitoring individuals improperly using this | | system, or in the course of system maintenance, the activities | | of authorized users may also be monitored. | | | | Anyone using this system expressly consents to such monitoring | | and is advised that if such monitoring reveals possible | | evidence of criminal activity, system personnel may provide the | | evidence of such monitoring to law enforcement officials. | | | |SLIS computing accounts expire: | |See: http://www.slis.indiana.edu/technology/help/ for details | |-----------------------------------------------------------------| stevecox@iris:~ $ Logging In • You are left with a prompt at the bottom of your login screen. • A command prompt generally ends with either a dollar sign ($) or a percent sign (%). There are two main types of command shells; those based on a Bourne shell (i.e. sh and bash) and those based on a C shell (i.e. csh and tcsh). Logging In • To keep you straight on which you are using, the two shells traditionally use different prompts: $ for Bourne shells % for C shells. • Your account on iris uses a Bourne shell derivative (bash to be specific). Installing your Practice Directory • During this module you will be using a practice directory structure complete with practice files and directories. • You will now install this into your home directory on iris. Getting your Practice Directory • Make sure you are logged into iris and type these commands: $ cd (press return) $ tar -xvf /tmp/Unix_class.tar • You will see a list of filenames and directories scroll by. You will learn more about the command you just used on your last day of this module. Unix Commands • Now you are logged into the system, but you need to know how to talk to the system or issue your commands. Unix Commands • There are a number of commands which you need to know in order to tell the system to do various things (show you directories, move files, copy files, search for files, etc.). Unix Commands • Unix commands generally have three parts or syntactic elements: command_name Example: $ ls • Tells the system to show you a list of files Unix Commands • Unix Commands generally have three parts: command_name [options] Example: $ ls -l • List files, in “long format” form (gives more information about the files) Unix Commands command_name [options] Note: In some texts and web links, options can also be referred to as “flags”. Unix Commands • Unix Commands generally have three parts: command_name [options][operands] Example: $ ls -l Unix_class • List files, in “long format” form, in the directory called ‘Unix_class’ Unix Commands • Unix Commands generally have three parts: command_name [options][operands] Note: In some texts and web links, operands can also be referred to as “arguments” Unix Commands • Not all commands will need all three parts. In fact, some will only need the command_name. However, others may require two [operands] Unix Commands Important to Remember: • Unix is case-sensitive; old.files is different from Old.Files. • The spaces between the command_name, the [option] and the [operand] are VERY important. who - Practice • One simple Unix command is used to find out who is currently logged in. At the shell prompt (the $), type who. $ who who - Practice • Example Output $ who herring pts/12 Jun 17 15:36 (herring.slis.indiana.edu) mnapier pts/4 Jun 14 21:29 (12-222-70-96.client.insightbb.com) mnapier pts/8 Jun 17 07:39 (dmitrii.slis.indiana.edu) jfieber pts/5 Jun 17 15:56 (d-1-1.dhcp-149-159.indiana.edu) htripath pts/3 Jun 17 11:10 (lair4.slis.indiana.edu) mnapier pts/9 Jun 16 09:00 (12-222-70-96.client.insightbb.com) stevecox pts/10 Jun 17 16:51 (wireless-73-28.wireless.indiana.edu) stevecox pts/13 Jun 17 16:34 (chionofuji.slis.indiana.edu) $ Unix Directories Directories • The information stored in the Unix system is hierarchical. • Like the “folders” on a Mac or Windows operating system, Unix works with “directories.” Directories • A directory can contain either files or more directories (often called subdirectories).
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages188 Page
-
File Size-