1 / 50

Title Slide

Internet Concepts The UNIX Operating System (1) By Ralph B. Bisland, Jr. CSS 404/504. Title Slide. Developed from the Multics Operating System project Developed at Bell Labs in 1969 (Originally called Unics) UNIX commands are text based (command interpreter)

hailey
Télécharger la présentation

Title Slide

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. Internet Concepts The UNIX Operating System (1) By Ralph B. Bisland, Jr. CSS 404/504 Title Slide

  2. Developed from the Multics Operating System project Developed at Bell Labs in 1969 (Originally called Unics) UNIX commands are text based (command interpreter) Windows version of UNIX: X-Windows The UNIX Operating System

  3. Called shells C-Shell (csh) TC Shell (tcsh) Korn Shell (ksh) Z shell (zsh) (what I use) Borne Shell (bsh) Borne Again Shell (bash) (USM CS Default) Versions Of UNIX

  4. Most Internet Service Providers (ISPs) utilize the UNIX Operating System Some ISPs use GUI interfaces - limit what you can do UNIX Operating systems have communications software built into their software. Why Learn UNIX

  5. UNIX commands are very cryptic (Often 2 letters) The case of UNIX commands is very important!!!!!!!! ls ¹ LS ¹ Ls UNIX commands are usually entered in lowercase UNIX Basics

  6. UNIX commands may have parameters Parameters are uused to specify options to commands Case is important here too Parameters are preceded by a dash Multiple parameters may be grouped together or specified separately Multiple parameters may be placed in any order the user desires Examples ls -a ls -al ls -la Command Parameters

  7. The UNIX prompt differs with each shell Z-Shell default prompt is: orca:~% This may be altered UNIX is not MS-DOS, Windows, or Macintosh OS X Since MS-DOS "borrowed" some concepts from UNIX, some UNIX concepts are very similar to MS-DOS UNIX Basics (ctd)

  8. For security reasons this must be done through secure shell (ssh) and not telnet. To get a free ssh client program enter ssh client (or ssh macintosh) into a search engine. You also try Putty (win32 client) Click on the Secure Shell icon to start it up. Click on “Quick connect” to connect to orca. Connecting to Orca

  9. To connect to a UNIX based computer system two things are needed: Login name (login ID) Password Login Names & Passwords

  10. General rules: 6-8 characters digits Can contain special characters such as -, _, and . Case sensitive This is assigned by the system administrator and can not be changed. This becomes your E-mail address. bisland@orca.st.usm.edu Login Names

  11. General rules: At least 6 characters, at least 2 must be non-lowercase letters Passwords should be kept confidential. Do not use simple names, dates, etc. as passwords. Use a sentence to create your password. Example: I am a Computer Science major IaaCSm Passwords

  12. To change your password, use the password command (passwd) Format: passwd NOTE: This will not work on the ocean system Example: orca% passwd Enter login (LDAP) password: New UNIX password: Retype new UNIX password: orca% Note that for security reasons the passwords are not echoed Changing Passwords

  13. To disconnect from orca, enter any of the following commands: (well most probably) logout (This one works all the time) exit bye lo (works for me) Remember that case is important when entering the commands!!!! After doing this you also have to exit the ssh client. Disconnecting from Orca

  14. A file is a collection of data that is stored on some secondary storage device. UNIX file names have no maximum storage limit. UNIX file are where the HTML commands for creating web pages are stored. UNIX Files

  15. Limited to 64 characters May contain special characters (except blank, / and possibly a leading -) Files that begin with a period (called a dot) have special meanings Case of letters is important. my-file ¹ MY-FILE ¹ My-File Convention calls for a file extension to be appended to each file name. Place a period after the file name and add the extension my-file.dat UNIX File Naming Conventions

  16. Directories/subdirectories are used to segregate files On PC/Macs these are called folders The UNIX directory system forms a tree or hierarchical structure The top directory of the tree is called the root Each user has a home directory (which is a subdirectory of root) The user's home directory is the user's login name UNIX Directories

  17. UNIX Directories Root Rimes Bisland Gregg Not exact but close enough for now

  18. You may currently "reside" in only one directory/subdirectory at a time. Once you transfer from one directory to another, you leave the first one and enter the second one. The directory/subdirectory that you currently reside in is called your "current working directory" (cwd) or "working directory“. Directory Notes

  19. Orca’s directory system is configured its UNIX directories as follows: /logical-computer-name/group-name/login-name (slashes separate subdirectories) Where logical-computer-name: Logical name of the computing systems group-name: Logical group name that the user falls into. Probably faculty, student, many others login-name: User's login name Example: /orca/faculty/bisland Orca’s Directory Structure

  20. Orca’s Directory Structure orca Faculty Students Staff others Bisland Gregg Internet Database SE-Eng T-Hunts Tests

  21. To create a subdirectory, use the make directory (mkdir) command Format: mkdir subdirectory-name Example: orca% mkdir internet-course The command creates a subdirectory in your working current directory Creation Of Subdirectories

  22. To make a subdirectory your current working directory, use the change directory (cd) command. Format: cd subdirectory-name Example: orca% cd internet-course Use the cd command by itself move back to your home directory from any subdirectory. Moving To Subdirectories

  23. Every directory contains two files called . (dot) and .. (dot dot) . => Name of the current working directory .. => Name of the superdirectory of the current working directory To move back up one level, use the command cd .. $ cd .. Moving To Subdirectories (ctd)

  24. To access a file in another directory, you must specify the path to the file The path may be specified in either of two ways: Absolute Path: The exact path to the file relative to the computer’s home directory Relative Path: Relative to the current working directory Files In Other Directories

  25. Relative Path Names Location of a file relative to the current working directory. bisland internet database grades projects Assume that the cwd is internet, the relative path to the file test1.dat in the subdirectory grades is grades/test1.dat Note that a slash does not precede the first subdirectory name

  26. Absolute Path Names Location of the file regardless of the current working directory bisland internet database grades projects Assume the cwd is database and we wanted to get to the file test1.dat in the grades subdirectory, the absolute path name is: /orca/faculty/bisland/internet/grades/test1.dat Note that absolute directory names are preceded by a slash Note that the absolute path name includes the logical computer name followed by the group name, followed by the logon name (the home directory), followed by the subdirectories

  27. The tilde symbol (~) can be used to get to a user's home directory UNIX uses it's internal files to find the specified home directory To get to the test1.dat file in the previous example, we could specify the path: /orca/faculty/bisland/internet/grades/test1.dat or using the tilde notation we could access it with the following path: ~bisland/internet/grades/test1.dat The Tilde Symbol

  28. To display the absolute path to your current working directory use the print working directory (pwd) command. Format: pwd Example: orca% pwd orca/faculty/bisland/internet Where Am I?

  29. Subdirectories can only be removed when they are empty! The only files they contain are . and .. (Removal of files is discussed later) To remove a directory, the cwd must be the parent directory To remove a subdirectory, use the remove directory command (rmdir) Format: rmdir subdirectory-name Example: orca % rmdir internet Removing Directories

  30. To display the names of the files in a directory use the list command (ls) Format: ls [-parameters] Example 1: (list the names of the files in the cwd) orca% ls Example 2: (lists the names of the files in the subdirectory internet-course) orca% ls internet-course Displaying A Directory

  31. Parameters: a: All files with a directory (including ones that begin with a period) F: Directories are displayed with a slash suffix and programs are displayed with an asterisk suffix l: Produces a long listing of each directory entry Example 3: (produces a long list of everything in cwd) orca % ls -l Displaying A Directory (ctd)

  32. There are several utility programs to list the contents of a file available in UNIX Catenate (cat): More (more) Less (less) Head (head) Tail (tail) Displaying The Contents Of A File

  33. Lists the contents of a file from top to bottom. If the file is too long to fit on a page, the excess is scrolled off the top of the page. Good for listing small files. Format: cat filename orca% cat my-file.dat Catenate

  34. Displays the first "page" of the file and waits for instructions Return Key = One new line is displayed Space Bar = One new page is displayed q = Quit the display Format: more filename orca% more my-file.dat More

  35. The head and tail commands are used to display parts of a text file. You may optionally specify the number of lines to list. Default is 10 lines Formats: head [-l] <filename> tail [-|+l] <filename> orca% head my-file.dat orca% tail my-file.dat orca% head -20 my-file.dat orca% tail -20 my-file.dat orca% tail +10 my-file.dat {list from line 10 to EOF} Head & Tail

  36. Text Editor: A program that allows the creation and editing of text files. This is what we will use to create the HTML files. Similar to a word processor but without all the features Text Editors create lines of text Each line is terminated by an EOLN mark Each file is terminated by an EOF mark No fancy editing features like a word processor Word wrap Boldface, centering, underlining, etc. UNIX Text Editors

  37. PICO = PIne COmposer Very simple text editor - can only be used on text files (ASCII files). Limited in what it can do (find and replace, delete multiple lines, etc.) Default editor on the orca system. Some of the PICO commands are shown across the bottom of the screen. All PICO commands begin with a control key (shown as ^letter). PICO

  38. To enter the PICO Editor, enter the word "pico", followed by a blank space, followed by the name of the file you wish to create/edit. orca % pico my-file.dat The screen will clear and the PICO edit window is now open. Use the arrow keys to move the cursor around. Whatever you enter will be entered in the text file. PICO (ctd)

  39. List Of The PICO Commands ^G: Help on PICO. (F1) ^F: Move the cursor forward one character. ^B: Move the cursor backward one character. ^N: Move the cursor down (next) one line. ^P: Move the cursor up (previous) line. ^A: Move the cursor to the beginning of the current line. ^E: Move the cursor to the end of the current line. ^V: Move cursor forward a page. (F8) ^Y: Move the cursor backward a page. (F7) ^W: Search for (where is) text neglecting case. (F6) ^L: Refresh the display. ^D: Delete the character at the cursor ^K: Delete (kill) the entire line at the current cursor position. (F9) Note: Consecutive deletes append lines to the buffer which subsequently undeletes will write at the current cursor position. ^U: Undelete the last line(s) deleted at the cursor. (F10) ^I: Insert a tab at the current cursor position.

  40. List Of PICO Commands (ctd) ^J: Format (justify) the current paragraph. (F4) Note: Paragraphs delimited by blank lines or indentation ^T: Invoke the spelling checker. (F12) ^C: Report the current cursor position. (F11) ^R: Insert an external file at the current cursor position. (F5) ^O: Output the current buffer to a file. (F3) ^X: Exit pico, saving the contents of the buffer to a file. (F2)

  41. Sample PICO Edit Session PICO 1.7 File: my-file.dat q [ New file ] ^G Get Help ^O WriteOut ^R Read File^Y Prev Pg ^K Del Line ^C Cur Pos ^X Exit ^J Justify ^W Where is ^V Next Pg ^U UnDel Lin^T To Spell

  42. To delete a file from the system, use the remove command (rm) Format: rm filename orca% rm my-file.dat You will probably be asked for confirmation when you remove a file. orca% rm my-file.dat rm: remove ‘my-file.dat’? Deleting Files

  43. In some file commands wild cards can be used to substitute for characters or character strings Wildcard Meaning -------- --------------------------------------------- * Match any sequence of zero or more characters ? Match any single character [ ] Match one of the enclosed characters Note: The only character that can not be matched by a wildcard is the slash (/) Wildcards

  44. Wildcard Examples orca% rm *.dat orca% rm file* orca% rm ?.dat orca% rm set[123].dat orca% ls -l *.dat orca% ls *.* orca% rm *

  45. To rename a file, use the move command (mv) Format: mv oldfile-name newfile-name Example: orca% mv my-file.dat your-file.dat Since a directory is in essence a file, directories can be renamed via the mv command. Format: mv old-directory-name new-directory-name orca% mv internet-course internet-stuff Renaming A File

  46. To make a duplicate copy of a file, use the copy command (cp) Format: cp old-file new-file Example: orca% cp my-file.dat your-file.dat Making A Duplicate Copy Of A File

  47. To move a file from one directory to another directory, use the mv command Format: mv <filename> <directory-name> Example: orca% mv my-file.dat internet-course To copy a file from one directory to another, use the cp command Format: cp <filename> <directory-name> orca% cp my-file.dat internet-course Files In Different Directories

  48. History allows you to retrieve previously entered commands. This only works on commands entered during the current terminal session. Once a command has been retrieved, it can be executed and/or editted. To retrieve previously entered commands use the up arrow or the down arrow key. To edit a command, use the backward or forward key to position the cursor at the editing point, then enter character or delete characters. History

  49. UNIX allows the user to enter enough character of a filename to determine a unique file name, then completes the file name for you. To do this, enter enough characters for UNIX to identify the file name, then press the TAB key – UNIX completes the file name for you. This feature only works on file names, not commands. Filename Completion

  50. Any text file may be printed on the laser printer in JST 205 or TEC207 Caution: Only print text files on the printer!!! The command to print a text file is lpr. Format: lpr <filename> Example: orca% lpr my-file.dat To check on the status of the USM printers use the lpstat command orca% lpstat Printing

More Related