Presentation is loading. Please wait.

Presentation is loading. Please wait.

Session 2 Wharton Summer Tech Camp Basic Unix. Agenda Cover basic UNIX commands and useful functions.

Similar presentations


Presentation on theme: "Session 2 Wharton Summer Tech Camp Basic Unix. Agenda Cover basic UNIX commands and useful functions."— Presentation transcript:

1 Session 2 Wharton 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 cygwin www.cygwin.com/

4 Wharton Grid

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

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 Command for listing directory contents Directory name. By default, if you don’t specify, it’s current working directory “.”

9 Control-key commands ctrl-c – interrupts a running program 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 1.Do some exercise posted “practice.sh” 2.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 Ssh uname@unix.wharton.upenn.eduuname@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, secureCRT etc)

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


Download ppt "Session 2 Wharton Summer Tech Camp Basic Unix. Agenda Cover basic UNIX commands and useful functions."

Similar presentations


Ads by Google