1 / 76

Review of: Chapters One - Four

Review of: Chapters One - Four. History of Unix OS. The Unix OS was developed (based on Multics & CTSS operating systems) by Ken Thompson at the AT&T Bell Laboratories in 1969. He wanted to create an multi-user operating system to run “space wars” game.

Download Presentation

Review of: Chapters One - Four

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. Review of:Chapters One - Four

  2. History of Unix OS • The Unix OS was developed (based on Multics & CTSS operating systems) by Ken Thompson at the AT&T Bell Laboratories in 1969. He wanted to create an multi-user operating system to run “space wars” game. • Ken’s philosophy was to create an operating system with commands or “utilities” that would do one thing well very well (i.e. UNIX).

  3. History of Unix OS • The first versions of UNIX were written in “machine-dependent” program (such as PDP-7). • Ken Thompson approached Dennis Ritchie developer of C program), and in 1973 they compiled UNIX in C programming language to make operating system “portable” to other computers systems.

  4. History of Unix OS • The Unix OS is a multi-user OS allowing more that more person to directly communicate with the computer. • Although the OS can only work on one task at a time, a small piece of time (time slice) is dedicated to each task or user - this is referred to as “time-sharing”. • Time sharing gives the illusion that the CPU is giving all the users its full attention

  5. History of Linux • Linux operating system developed by Finnish programming student named Linus Torvalds • Linus wanted to develop Unix-like OS just to experiment with the new 386 MHz personal computer

  6. Introducing the UNIXOperating System • UNIX can be used on systems functioning as: • Dedicated servers or client workstations in a server-based network • Client/server workstations connected to a peer-to-peer network • Stand-alone workstations not connected to a network

  7. Introducing the UNIXOperating System • UNIX is a multi-user system • Allows many users access and share the resources of a server computer • UNIX is a multitasking system • Allows user to execute more than one program at a time • UNIX is a portable operating system • Used in many computing environments

  8. UNIX Concepts • Shell • The interface between user and OS • Hierarchical Structure • Directory and subdirectory organization • Layered components • Layers of software surround the computer’s inner core

  9. Linux and UNIX • Linux is UNIX-like • Not written from traditional UNIX code • Linux is original code • Includes POSIX standards • Other Linux information • Created by Linus Torvalds • Offers all the complexity of UNIX • Linux can coexist with other OSs

  10. Connecting to a UNIX System • Remotely through Telnet/Secure Shell • Through network client software • As peer on peer-to-peer network • On a stand-alone PC • Through a dumb terminal

  11. Connecting to UNIX • Telnet • terminal emulation software • Easy and unsecure • Secure Shell • Terminal emulation software • Session encrypted end-to-end • Bundled with secure ftp and copy • X-Windows

  12. Logging in to UNIX • Log in by entering username and password when UNIX system booted or connected to • Enter at prompt (command-line mode) or into login box (GUI mode) • You’re at the Shell prompt -- Now commands can be issued at the command prompt

  13. Your Shell • Shells interpret commands and act as first-class programming languages • A default shell is associated with your account when created – Bash is the default shell in Linux (cat /etc/shells) • A short list of some UNIX shells: • Bourne (original Unix shell) • Cshell (similar to C programming language) • Korn (backwards-compatible upgd to bourne) • Bash (combo of Bourne, C and Korn shells)

  14. Entering Commands • To interact with UNIX, a command is entered at the command prompt • UNIX is case-sensitive and most commands are typed in lower case • Two categories of commands • User-level: perform tasks • System administration: system management

  15. Entering Commands • The date command • Displays the system date, which the system administrator maintains • The cal command • Shows the system calendar • The who command • Shows who is using the system and their current location

  16. Entering Commands • Command-line editing • Certain keystrokes perform command-line editing (shell dependent) • Multiple command entry • More than one command on one line by separating with a semicolon(;) • The clear command • Clears the current screen

  17. Entering Commands • Command-line history • Use up and down arrow keys to scroll through command history • The whatis command • Displays a brief description of a command for help purposes • Note the numbers in ()’s – that is the man section

  18. Logging Out of UNIX • Logging out ends your current process and indicates to UNIX that you are finished • Logging out is shell dependent • Bourne, Korn, Bash – exit or Ctrl-D • C shell – logout command

  19. Understanding the Role of the UNIX System Administrator • System administrator manages the UNIX system • Adds users and deletes old accounts • Called root (also called the superuser) • Unlimited permission to alter system (in other words very dangerous) • Prompt ends with # (pound) symbol • Normal user prompt $(dollar) %(percent) symbol

  20. Changing Passwords • For security purposes, changing passwords is necessary • Use the passwd command • UNIX allows new password if: • The new password differs by at least three characters • It has six or more characters, including at least two letters and one number • It is different from the user name • passwd To change current user’s password • passwd<username> To change specified user

  21. Viewing Files with cat, more, less, head, and tail Commands • Use cat, more, lessandtail to view file contents: • cat displays a whole file at one time • more displays a file one screen at a time, allowing scroll down • less displays a file one screen at a time, allowing scroll down and up • tail displays the end of a file • head displays the beginning of a file

  22. Viewing Files with cat, more, less, head, and tail Commands • Use head and tail to view the first few or last few lines of a file • head displays the first few lines • tail displays the last few lines

  23. Redirecting Output • The greater than sign (>) is called a redirection symbol • Create a new file or overwrite an existing file by attaching (>) to a command that produces output • To append to an existing file, use two redirection symbols (>>)

  24. Understanding the UNIX File System • A file is the basic component for data storage • UNIX considers everything it interacts with a file • A file system is UNIX’s way of organizing files on mass storage (disk) devices • A physical file system is a section of the hard disk that has been formatted to hold files • The file system is organized in a hierarchical structure similar to an inverted tree

  25. Understanding the Standard Tree Structure • The structure starts at the root level • Root is the name of the file at this basic level and it is denoted by the slash character (/) • A directory is a file that can contain other files and directories • A subdirectory is a directory within a directory • The subdirectory is considered the child of the parent directory

  26. Using UNIX Partitions • The section of the disk that holds a file system is called a partition • When installing UNIX, one of the first tasks is deciding how to partition a storage device, or hard disk • Hard disks may have many partitions • UNIX partitions are given names

  27. Using UNIX Partitions • Storage devices are called peripheral devices • Peripheral devices connect to the computer through electronic interfaces • IDE - Integrated Drive Electronics • SCSI - Small Computer System Interface (sda1)

  28. Exploring the Root File System • UNIX must mount a file system before any programs can access files on it • To mount a file system is to connect it to the directory tree structure • The root file system is mounted by the kernel when the system starts

  29. Exploring the Root File System • The root directory contains sub-directories that contain files: • /bin contains binaries, or executables needed to start the system and perform system tasks • /boot contains files needed by the bootstrap loader as well as kernel images • /dev contains system device reference files (Next slide is wrong. Should /dev)

  30. Exploring the Root File System • Root subdirectories continued: • /etc contains configuration files that the system uses when the computer starts • /lib contains kernel modules, security information, and the shared library images • /mnt contains mount points for temporary mounts by the system administrator • /proc is a virtual file system allocated in memory only

  31. Exploring the Root File System • Root subdirectories continued: • /root is the home directory of the root user, or the system administrator • /sbin contains essential network programs used only by the system administrator • /tmp is a temporary place to store data during processing cycles • /var contains subdirectories which have sizes that often change, such as error logs

  32. Using the Mount Command • Users can access mounted file systems which they have permission (covered later) to access • Additional file systems can be mounted at any time using the mount command • To ensure system security, only the root user uses the mount command

  33. Paths and Pathnames • To specify a file or directory, use its pathname, which follows the branches of the file system to the desired file • A forward slash ( / ) separates each directory name • The UNIX command prompt may indicate your location within the file system • Use the UNIX pwd command to display the current path name

  34. Bash Prompt Syntax • To see your PS1 variable type and enter: echo $PS1 • To read more look at the man page for bash man bash

  35. Navigating the File System • To navigate the UNIX directory structure, use the cd (change directory) command • UNIX refers to a path as either: • Absolute - begins at the root level and lists all subdirectories to the destination file • Relative - begins at your current working directory and proceeds from there

  36. Managing Directories and Files • mkdir (make directory) command • Create a new directory • rmdir (make directory) command • Delete an empty directory • cp (copy) command • Copy files from one director to another • rm (remove) command • Delete files

  37. Setting File Permissions

  38. Setting File Permissions

  39. Setting File Permissions • chmod command • To set file permissions • Settings are read (r), write (w), execute (x) • The three types of users are owners, groups, and others • Setting permissions to directories • Use execute (x) to grant access

  40. vi editor Pronounced: `vee eye‘’

  41. What is vi ? • The visual editor on the Unix. • Before this the primary editor used on Unix was line editor • User was able to see/edit only one line of the text at a time • The vi editor is not a text formater • you cannot set margins • center headings • Etc…

  42. Characteristics of vi • The vi editor is a very powerful but at the same time it is cryptic • It is hard to learn, specially for windows users • The best way to learn vi commands is to use them

  43. Vim equals Vi • The current iteration of vi for Linux is called vim • Vi Improved • http://www.vim.org

  44. Starting vi • Type vi filename at the shell prompt • After pressing enter the command prompt disappears and you see tilde(~) characters on all the lines • These tilde characters indicate that the line is blank

  45. Vi modes • There are two modes in vi • Command mode • Input mode • When you start vi by default it is in command mode • How can you go to command mode from input mode? • By pressing the Esc key

  46. How to exit from vi • First go to command mode • press Esc There is no harm in pressing Esc even if you are in command mode. Your terminal may just beep or flash if you press Esc in command mode • There are different ways to exit when you are in the command mode

  47. How to exit from vi • :q <enter> is to exit, if you have not made any changes to the file • :q! <enter> is the forced quit, it will discard the changes and quit • :wq <enter> is for save and Exit • :x <enter> is same as above command • ZZ is for save and Exit (Note this command is uppercase)

  48. Moving Around • You can move around only when you are in the command mode • Arrow keys usually works(but may not) • The standard keys for moving cursor are: • h - for left • l - for right • j - for down • k - for up

More Related