1 / 33

Introductory Concepts to Computing

Introductory Concepts to Computing. Natalie D. Tourville January 20 th , 2009 Atmospheric Science Colorado State University. Summary of Topics. Operating system Quick history of computing Unix , Linux computing environments Basic Unix commands Shells – how to setup and use

jubal
Télécharger la présentation

Introductory Concepts to Computing

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. Introductory Concepts to Computing Natalie D. Tourville January 20th, 2009 Atmospheric Science Colorado State University

  2. Summary of Topics • Operating system • Quick history of computing • Unix, Linux computing environments • Basic Unix commands • Shells – how to setup and use • Atmos Computing Environment • Getting help

  3. Why care about the os? • Most critical software in a computer. • OS performance influences the performance of all software on a computer • How to extract the best performance out of an OS? • How to work around design flaws? Write software that takes advantage of the design of the OS

  4. Why care about the os? • You need to understand enough to make informed decisions about things like: • Buying and using a personal computer: • Why do different PCs with the same CPU perform differently? • Should I get Windows XP? Windows 2000? Linux? What’s the difference? • Should I upgrade my hardware? Should I upgrade my OS? • What’s going on with my PC, especially when I have to install something? • Should I use disk compression? Is there a cost to using it?

  5. History of Computing • First generation 1945 - 1955 • Technology: vacuum tubes & plugboards • Programming: setting some switches • Programming language: machine language • Tasks: tables of sine, cosine, logarithms • OS: none • Computer designer is: • builder and • programmer and • operator and • “sys admin”

  6. History of Computers • Second generation 1955 – 1965 • Technology: Transistors • Programming: Punched cards • Programming languages: FORTRAN & Assembly • Tasks: Scientific • Computer: Mainframes • OS: Batch system • Universities started to buy computers (millions $) • Separation between computer designers, builders, operators, programmers and maintenance personnel.

  7. bring cards to IBM 1401 machine (good at card reading) • read cards to tape • put tape on IBM 7094 which does computing • put tape on IBM 1401 which prints output offline

  8. History of Computing • Third generation 1965 – 1980 • Technology: Integrated circuits • Programming: Punched cards • Programming languages: FORTRAN & Assembly • Tasks: Scientific & commercial • Computers: IBM 360, DEC PDPs • OS: Multiprogramming/timesharing, spooling • OSes Developed: • MULTICS (father of all modern OSes) • UNIX (System V, BSD) • POSIX – Portable Operating System Interface (by IEEE) • MINIX – 16 bit academic os (by Tanenbaum) • Linux (originated by Linus Torvalds, inspired by MINIX)

  9. History of Computing • Fourth generation 1980-Present • Programming: High level • Programming languages: C/C++, Java, …… • Computer: PC, rack mount systems, clusters • OS: Windows, MacOS, Linux …… • www.top500.org – 500 most powerful computers • Cheap Desktop PCs

  10. What is Linux? Open source operating system Developed by Linus Torvalds at the U. of Helsinki in Finland since 1991. Under GNU GPL, its source code is free for everyone to download and use. One of the most popular, especially for a server markets

  11. Linux • Source code can be modified to fit your need. • Quite portable – good for new hardware products • Supports various hardware platforms. Majority on x86 • True multi-tasking operating system. • Being immunized against all kinds of viruses.

  12. Linux • Linux supports many different types • Most commonly, ext2fs Filenames of 255 characters • File sizes up to 2GB+ • File Systems 4TB+ • Derived from extfs • Highly reliable and high performer • Many different flavors – Debian, RedHat, Ubuntu, Fedora, slackware, gentoo, etc.

  13. Macintosh History • Mac OS X is a Unix-based operating system, built on technologies developed at NeXT between the second half of the 1980s and Apple's purchase of the company in early 1996 • Mac OS X is based on the Mach kernel and is derived from the Berkeley Software Distribution (BSD) • named after large cats (leopard, tiger, etc)

  14. Mac OS • Closed source with open source technology • Mac OS X's core is a POSIX compliant operating system (OS) built on top of the XNU kernel, with standard Unix facilities available from the command line interface. • Apple released this set of software as a free and open source operating system named Darwin. • On top of Darwin, Apple layered a number of components, including the Aqua interface and the Finder, to complete the GUI-based operating system which is Mac OS X.

  15. Unix Basics • Access Control: “cd” “ls –l” and “chmod” commands rwx rwx rwx  7 7 7 rwx r_x r_x  7 5 5 • Consulting the on-line manual  man command • Compiling with “gcc” and “g++” • I/O Redirection >Redirect output <Redirect input p&Run p in the background (try also jobs, ^Z, bg, fg, ps,and kill) p1| p2Pipe output of p1 as input for p2 p >> fAppend output of p into file f

  16. Common operations • ls (list) command: directory’s contents (files and subdirectories) • ls–l: in detail • ls–a: hidden files also • Wildcard: *: any string ?: any character • Redirection: ls –l > somefile • date: date and time • whoami: current user • finger a username: get someone’s login

  17. Sample Unix commands • A subset of these commands are: alias/unalias, bg, cat, cc, cd, chmod, cp, csh, diff, du echo, emacs, fg, gcc, grep, history, jobs, kill, ln, logout, lpq, lpr, lprm, ls, man, mkdir, more, mv, printenv, ps, pwd, rlogin, rm, rmdir, rsh, script, set, setenv, source tail, tar, telnet, touch, unset unsetenv uudecode, uuencode, vi, wc, which, xterm

  18. Standard Files • UNIX concept of “standard files” • "standard input (where a command gets its input) -default is the terminal • wc <input • "standard output (where a command writes it output) -default is the terminal • ls -l >output • "standard error (where a command writes error messages) -default is the terminal

  19. Create/edit a file • Vi, vim, gvim- http://bullium.com/support/vim.html • Emacs – http://refcards.com/docs/wingb/xemacs/xemacs-refcard-a4.pdf • Pico • joe • Any of you favorite editor

  20. File Name Conventions • Some file names are special: • / The root directory (don’t confuse with the root user) • . The current directory • .. The parent (previous) directory • ~ My home directory • ~jane - Jane’s home directory • Examples: ./a same as a • ../jane/x go up one level then look in directory jane for x • pwd will tell where you are in the directory tree

  21. Creating Files and Directories • Files can be created in a number of ways • The output of a command Being edited using vi or your favorite editor • By using the touch command which creates an empty file or updates the modification and access time information of an existing file • Directories are created using the mkdir command

  22. Links • Links are references to files (aliases) • Two forms: • Hard • Symbolic • Can point to files on different physical devices Delete of original leaves link / Delete of link leaves original • Can be created for directories • Create using ln or ln -s command The ls –l command will show you the links

  23. File Permissions • Use the chmod command to change file and directory permissions • Important if you want to execute files/script or view web pages in your directory • The permissions are encoded as an octal number • chmod 0755 file # Owner=rwx Group=r-x Other=r-x • chmod 0500 file2 # Owner=r-x Group=--- Other=--- • chmod 0644 file3 # Owner=rw- Group=r-- Other=r– • chmod +x file # Add execute permission to file for all chmod u-r file # Remove read permission for owner chmod a+w file # Add write permission for everyone

  24. Getting around to other computers • ssh – secure protocol • telnet/ftp – insecure protocols • scp – secure copy transfer • ssh –Y – forward your X11 connections • mount • CSU VPN – recommended for accessing the CSU network from outside the network

  25. Shells • sh - Bourne shell • the original csh - C shell -compatible with Bourne shell • bash - Bourne again shell -most common on Linux • tcsh - The enhanced C shell • zsh - Z shell -new, compatible with Bourne shell • ksh - Korn shell -most popular UNIX shell • Change your shell – chsh • Modify your shell - source

  26. Bash shell - startup • When Bash is invoked as an interactive login shell, or as a non-interactive shell with the `--login' option, it first reads and executes commands from the file `/etc/profile', if that file exists. • After reading that file, it looks for `~/.bash_profile', `~/.bash_login', and `~/.profile', in that order, and reads and executes commands from the first one that exists and is readable. The `--noprofile' option may be used when the shell is started to inhibit this behavior. • When an interactive shell that is not a login shell is started, Bash reads and executes commands from `~/.bashrc’ (e.g. starting up a terminal).

  27. Sample .bashrc The ~/.bashrc file determines the behavior of the shell, and of shell scripts. A proper understanding of this file can lead to more effective use of scripts. #Setup: source this file in $HOME/.bashrc with following block $PATH=$PATH:/usr/bin:/usr/sbin:/bin:/sbin:. export PATH=$HOME/scripts:\ $JAVA_HOME:/usr/share/java $JAVA_HOME/bin:/opt/javautil/bin:\ # System shell commands alias cp='cp -rvf’ alias mv='mv -vf’ alias ll='ls -l’ alias la='ls -A’ alias l='ls -CF’ alias f='find . -name’ alias s='sort’ alias sdate='date +%d-%b-%Y’ alias mdate='date +%d-%b-%Y_%H%M’ alias ldate='date +%a_%d-%b-%Y_%H%M’ alias psg='ps auxwww|grep -v grep | grep’ alias hd='od -Ax -tx1z -v’ alias printpath='readlink -f’ alias tar='tar -vf’ alias rsync='rsync -va’ alias chmodx='chmod a+x’ alias myip='nslookup `hostname`’ alias reload='exec bash’ # Application specfic commands alias svnu='svn update’ alias svnc='svn ci . -m’ alias mb='mate $HOME/scripts/my.bashrc’ alias ms='mate $HOME/scripts’ # alias sshhub='ssh root@something.com'

  28. Sample .cshrc file • The .cshrc file in your home directory is read every time a new C-shell is launched, and is used to ensure that the working environment is always correct. • ----- Aliases ----- # • alias h history • alias rm "rm i" • alias dir "ls -al | more" • alias md mkdir • alias rd rmdir • alias vt100 "set term=vt100" • alias wy60 "set term=wyse60" • # • # ----- Environment Control ----- • # • mesg y # let other users write messages to my screen • notify -y # inform me when mail arrives • set history = 50 # remember the last 50 commands • set path = ( /usr/bin /bin /usr/ucb/bin /usr/local/bin . ) • #

  29. Atmos Computing • Typically each group has own set of computers and or clusters for use to students. • Backbone network of 100 mbps to campus – gb backbone to annex, chemistry and acrc • Each group is different with a variety of platforms from Linux, Mac and Windows desktop

  30. Atmos Computing • New computing facility located sw of the Annex • 2000 sq ft with room for 84 racks • Tentatively scheduled for completion ~ January 2010 • Current server room in middle of atmos build to accommodate 1970’s computing technology. • Modular components – AC and power

  31. Getting Help • The Linux equivalent of HELP is man (manual) • "Use man -k <keyword> to find all commands with that keyword • "Use man <command>to display help for that command • #Output is presented a page at a time. Use b for to scroll backward, for a space to scroll forward and q to quit • Example – man ssh

  32. Computing Help • System Administrator • internet/google for questions • Ask around – someone has already experienced the same problem you have

  33. Questions? Comments?

More Related