1 / 15

Session 2 Wharton Summer Tech Camp

Session 2 Wharton Summer Tech Camp. Basic Unix. Agenda. Cover basic UNIX commands and useful functions. UNIX. Operating System AT&T – Bell Lab 1969 Ken Thompson, Dennis Ritchie, Brian Kernighan, etc (picture: Ken Thompson and Dennis Ritchie standing)

fran
Download Presentation

Session 2 Wharton Summer Tech Camp

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. Session 2Wharton Summer Tech Camp Basic Unix

  2. Agenda • Cover basic UNIX commands and useful functions

  3. UNIX • Operating System • AT&T – Bell Lab 1969 • Ken Thompson, Dennis Ritchie, Brian Kernighan, etc(picture: Ken Thompson and Dennis Ritchie standing) • Linux, Mac OSX descended from Unix • For Windows, Unix-like environment can be achieved by • Just Logging into Unix.wharton.upenn.edu OR • Install cygwinwww.cygwin.com/

  4. Wharton Grid

  5. Unix Prompt • [leedok@hpc-login2 ~]$ Current Directory name (~ means home) user name network node hostname

  6. Unix Shell • Unix Shell: A Unix shell is a command-line interpreter or shell that provides a traditional user interface for the Unix operating system and for Unix-like systems. (WIKI) • Basically, a translator between unix OS (kernel) and user, delivering commands. • There are many varieties: bash, tcsh, csh, ksh • Bash is the most popular

  7. Information look up • Manual page: “man [command]” “man man” • Google everything! • Stackoverflow.com

  8. Command Structure • [Command] [Options] [Argument] • ls –l directory • Directory structure separated by “/” • /home/opim/leedok • Important Startup File: ~/.bash_profile Directory name. By default, if you don’t specify, it’s current working directory “.” Command for listing directory contents Command for listing directory contents

  9. Control-key commands • ctrl-c • interrupts a runningprogram • ctrl-z • suspends a running program • (use the fg command to continue the program)

  10. Directory Navigation • ls - list content of a directory • pwd– print working directory • cd – change directory • mv– move file or rename • cp - create a copy of a file • rm– remove a file • mkdir– create a new directory • rmdir– remove a directory

  11. Some other commands • who - list who is on system • echo, printf– display a message • script- log all interaction in a file • clear- clear the screen • cat, more, less – file perusal • du – file info • chmod– change permission • find: • By Name: find . –name \*.ado • By Type: find . –type d (directory) • Etc

  12. Pipes and Redirects • > - Redirect output from a command to a file on disk. • >> - Append output from a command to an existing file on disk. • < - Read a command's input from a disk file, rather than the user. • | - Pass the output of one command to another for further processing. • Date > date.txt • Date >> date.txt • who | cut -f1 -d" " | sort -u

  13. Bit more advanced commands • grep – match string patterns (search) • sed, awk– find and replace (text manipulation)

  14. Lab session • Do some exercise posted “practice.sh” • Do Unix tutorial if you are new to it http://www.ee.surrey.ac.uk/Teaching/Unix/ 1: Log into unix account if you have one Sshuname@unix.wharton.upenn.edu 2: If you have Mac OS, just open up the “Terminal” 3: If you have Linux, you probably know this 4: if you have Windows, download terminal applications (e.g., putty, secureCRTetc)

  15. For the next session • Download and install Canopy – packaged python • https://www.enthought.com/products/canopy/academic/ • People with EDU email gets it for free

More Related