Class Notes (835,300)
Canada (509,079)
CS 138 (14)
Lecture

Data Lecture 2.docx

3 Pages
112 Views
Unlock Document

Department
Computer Science
Course
CS 138
Professor
Michael Godfrey
Semester
Winter

Description
Data Lecture 2 Thursday, January 10, 2013 More useful commands  echo o Write arguments, separated by spaces and terminated with newline o Evaluates written variables when in “ ” or no quotes, echos string in ‘ ‘  Globbing o Command-line pattern expansions o Apply only to args (often, file names) not commands or options o * matches 0 or more characters  q* matches filenames that start with q of any length  DOES NOT MATCH DOTFILES o ? matches 1 character  q*.?? matches q2y.cc o {…}  Alternative in the set o […]  One character in the set o [!...]  One character not in the set o [0-3]  Ranges using hyphen o Examples  $ ls *.pdf *.txt  List all pdf and txt  $ rm *.docx *.doc *.pptx *.ppt  Remove all Office files  $ cd /Users/migod/Music/iTunes/iTunesMusic/BiebersGold  …  find o Searches for files/dirs. within a directory hierarchy, according to various stated criteria o Find [ dir-list ] [ expr ] o Options  -name pattern restricts file names to globbing pattern  If dir-list omitted, search starting in current dir  If expr omitted, match all file names (like –name “*”)  -type f | d  Select only normal files/directories  …  -not expr  Logical not, and and or  … o Examples  $ find –name “t*”  Finds all files starting with t, starting in current dir  grep/egrep/fgrep o egrep  Extended Global Regular Expression Print  Search and print lines matching pattern in files  egrep [-irnv] pattern-string file-list  -i ignore case  -n print line numbers for matches  -r search recursively thru all sub-directories
More Less

Related notes for CS 138

Log In


OR

Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


OR

By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.


Submit