what is unix
play

What is Unix? Unix is a multi-user Operating System Pros Intro To - PowerPoint PPT Presentation

What is Unix? Unix is a multi-user Operating System Pros Intro To Unix Powerful, reliable, stable, secure CS-121 Cons Designed for programmers (ie not regular people) Difficult to learn at first (though not all versions) Since Then Lot


  1. What is Unix? Unix is a multi-user Operating System Pros Intro To Unix Powerful, reliable, stable, secure CS-121 Cons Designed for programmers (ie not regular people) Difficult to learn at first (though not all versions) Since Then Lot’ s of Unix History Versions! First Version Written in 1969 by Ken Thompson of Bell <<See the Unix family tree>> Laboratories Called UNICS (Uniplexed Operating and Computing System) Later shortened to Unix

  2. About Unix Components in Unix Designed from the ground up to be multi- Kernel: The OS itself a program that user manages resources and access to the hardware Different users have different privileges Shell: A program that allows the user to If a user’ s program crashes it should not interact with the computer/OS affect other users etc. We’ll be using Graphics Shells these pretty Resources: Memory, CPU Time, Disk-space standard across can all be managed between users Command line shells all versions of Unix Interacting with Unix Things to know about Unix Unix is case sensitive (for file names for commands for everything CaPiTaLiZaTioN Matters) There’ s a singe file hierarchy (ie no A: B: C:) Everything start at the root directory /. Example File Hierarchy The file separator is / (not \)

  3. Important Directory Command Line Shells Names Different users can use different shells: You can switch at anytime. . (dot) : The current directory sh : Shell (first shell ever written) .. (dot dot) : The parent directory ksh : The Korn shell We’ll be using ~ (tilde) : Your home directory. A directory csh : The sea shell this one in which you own. The current directory when class. Default for Idaho Unix you log in. tcsh : The “terrific” C shell accounts. Lots of neat features. bash : The Bourne-again shell “easy” to use! Common Unix Commands Common Unix Commands Some commands are small programs located in /bin/ ls : Shows files in the current directory mv file1 file2 : Move (rename) file1 to file2 cat file : Prints the specified file to screen rm file : Delete (Remove) a file cd dir : Changes the current directory mkdir dir : Make a new directory Other pwd : Print the current directory man command : Find out information about a commands are “built-in” to the specific command. ie: man ls cp file1 file2: Copy file1 to file2 shell. These commands are described These commands are described in detail in your jargon glossary in detail in your jargon glossary

  4. Other Unix Running a program from the current directory Programs:Editors An editor is a word-processor like program When you run a program from the current that allows you to edit text files. directory you have to specify the full path for security reasons. Many Editors Available in Unix So to run: program in your current directory vi you type We’ll be learning emacs -- very pico powerful: editor takes a while to learn. ./program We’ll go over it in class. emacs Other Unix Programs: Login in to your Unix Compilers Account A compiler translates a description of a We login to our uidaho Unix accounts using program in a text file into machine code. ssh (The secure shell) Different compilers for different Secure shell is a shell that works on your programming languages: Pascal, Fortran, C, C+ current computer and sends all commands +, etc. to another shell (in our case bash) running remotely on another computer. We’ll be using g++, to compile a program in a file called program.cpp we input ssh is secure because everything is encrypted between both machines. g++ program.cpp -o program

  5. Login in to your Unix Login in to your Unix Account Account From Home Download (Links are on the website) From any ITs Windows Lab: Putty - Putty is a simple ssh client for Start->Programs->SSH Secure Shell->SSH windows use it to login remotely to Client (this may very sightly from one Unix machines machine to another). Psftp - is used to transfer files between machines No Graphics Shell with If you want a graphics Putty! shell.. If you run any kind of Unix OS: Linux, Mac OS X etc. Just open up a terminal and type: You can’t point and click. ssh -X will7759@sunsol.uidaho.edu All of your commands will have to be here will7759 is your user name accessed from the keyboard. You MUST be running X11 (which is essentially your graphics shell) X11 comes free with all Unix OS

  6. If you want a graphics When using a graphics shell on Windows shell.. If you run Windows you can use cygwin You need a very fast internet connection Cygwin is a Unix emulation layer for Cable and DSL may be Okay windows. But not dial-up :-( It includes X11 Working with Files Login in Example CS-120

  7. Review: I/O using cin, cerr, the other standard cout stream cin, cout : Standard input and standard Besides cin, and cout -- there is cerr output. cerr is like cout except that it is meant to We can do simple I/O operations by simply output error messages redirecting input or output on the command line in Unix. cerr is useful : when you redirect output, you’ll still see an error on the screen ./my_program < input_file > output_file Redirecting stderror/ Redirecting cerr stdoutput To redirect both cout and cerr from Unix do ./program 2>err.out 1>output.out ./program &> output_file.txt

  8. Redirecting Output to Another program ./program1 | ./program2 Examples ls | less ls lists all directories less shows input one page at a time

Recommend


More recommend