cs246-s11-001-may10

cs246-s11-001-may10 - CS 246(Spring 2011 Section 1 Tuesday...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 246 (Spring 2011) – Section 1 Tuesday 10 May The Shell
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
CS 246 (Spring 2011) - Section 001 - Tuesday 10 May 2 Today's Agenda Globbing vs. regular expressions (egrep) 1.5 System Commands 1.6 File Permissions 1.7 Input/Output Redirection
Background image of page 2
CS 246 (Spring 2011) - Section 001 - Tuesday 10 May 3 Globbing vs. egrep: different syntax Globbing Matches patterns for file and directory names * = 0 or more characters ? = any one character {…} = matches alternatives in the set egrep Matches regular expressions for lines within files * / + = 0 / 1 or more of the previous item . = any one character {} = used to specify number of copies
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
4 G R C H E A T A N T T S Example: Cheating at Scrabble Sample regular expressions used to search a words file: 'oo' '^ma' '^a. ...s$' '^[a-z]{0,1}t[a-z]{2}t$' '^[aml][ia][iloams]$' I L O A M O S Our letters:
Background image of page 4
CS 246 (Spring 2011) - Section 001 - Tuesday 10 May 5 Other egrep examples Find all lines containing city names in the file cities.txt that do not appear at the end of a line Find all lines containing binary sequences (i.e., composed of only 0s and 1s) in the file numbers.txt Find the line numbers of all lines which contain a for loop involving variable n within any file found in the current directory (or any of its subdirectories) Find lines in data.txt containing an equal number of a's, b's, and c's (upper or lower case).
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
CS 246 (Spring 2011) - Section 001 - Tuesday 10 May 6 1.5 System Commands We have already mentioned the man command ssh : remote login to another machine ssh -Y [email protected] -Y allows display of windows on local machine Example: ssh -Y [email protected] Password: cd cs246 mkdir a1 cd a1/ emacs sample.txt &
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 20

cs246-s11-001-may10 - CS 246(Spring 2011 Section 1 Tuesday...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online