CS2043: Unix Tools & Scripting
Spring 2012
Announcements
Course description
An introduction to Unix, emphasizing tools for file management,
communication, process control, managing your Unix environment, and
rudimentary shell scripts. Knowledge of at least one programming language is
encouraged. Assignments assume no previous knowledge of Unix or expertise in any particular language.
CS2043 is a six week, two credit, S/U only course. It runs
January 23 to March 2, 2012. The drop deadline is 1/30/12, one week
into the course. The course number is: 15510.
Organization
-
When & Where: MWF 11:15am - 12:00pm (203 Thurston)
-
Staff:
| Instructor: |
Hussam Abu-Libdeh |
[first name @cs.cornell.edu] |
Office hours: |
Wednesdays |
12:00pm - 1:00pm (Upson 4139) |
| TA: |
Lisa Fawcett |
[lcf38 @cornell.edu] |
Office hours: |
Thursdays |
12:00pm - 1:00pm (Upson 328) |
| TA: |
Jason D'Souza |
[jrd248 @cornell.edu] |
Office hours: |
Fridays |
10:10am - 11:10am (Upson 328) |
Grading and course policies
There will be no official textbook for this course; below you may find
some books and websites that might be helpful. There are many books on
this subject, so pick your favorite one. Feel free to contact the staff if
you have any questions about this course.
There will be 5 or 6 homework assignments. You must complete all these
assignments to pass this class. Please take a look at
Cornell University Code of Academic Integrity.
Please follow these guidelines when submitting your work.
Lectures
- 1/23/2012 Lecture 1 A brief intro to Unix history.
- 1/25/2012 Lecture 2 Basic commands: Moving around the Unix file system, file ownership, and permissions.
- 1/27/2012 Lecture 3 Making Bash work for you.
- 1/30/2012 Lecture 4 Everyday commands: compression and accessing remote resources with ssh and sftp.
- 2/01/2012 Lecture 5 wc, sort, uniq, tr. Plus pipes and input/output redirection.
- 2/03/2012 Lecture 6 Processes, jobs, and the screen command.
- 2/06/2012 Lecture 7 Looking for things: 'find' and 'grep'.
- 2/08/2012 Lecture 8 Working with streams: 'sed' and 'awk/gawk'.
- 2/10/2012 Lecture 9 A quick intro to vim and gunplot.
- 2/13/2012 Lecture 10 Beginning bash shell scripting: variables, quotes, arguments, and if conditionals.
- 2/15/2012 Lecture 11 Continuing bash shell scripting: loops, case statements, and reading input lines. Example from class: rss.sh.
- 2/17/2012 Lecture 12 Variable string manipulation, Arrays, and general Q&A. Class examples: avg.sh (use with numbers.txt), 1dirup.sh, and flatten_dirs.sh.
- 2/20/2012 Lecture 13 Intro to Python: syntax, conditionals, loops, functions. Also check out the Python Tutorial.
- 2/22/2012 Lecture 14 More Python: modules, classes, and in class examples. Also check out the Python Tutorial. Class examples: rss.py (must install the feed parser module), and myserver.py (run this script then go to http://localhost:8000 from your browser).
- 2/24/2012 Lecture 15 More Python: functional programming, lambda expressions, list comprehension, function arguments, and more.
- 2/27/2012 Lecture 16 Periodic execution with cron, and compiling with make.
- 2/29/2012 Lecture 17 Network programming in Python. Checkout the SocketServer and socket classes.
- 3/02/2012 Lecture 18 Potpourri: installing packages repositories on Debian-based distros (e.g. Ubuntu) using apt, smarter directory navigation using pushd/popd/dirs. Additionally, see the manual page for pushd/popd.
Homework
Very Useful links
Useful (but not required) books
- UNIX Shells by Example (2nd ed), E. Quigley,
Prentice
Hall,2000
- excellent presentation of all five
leading UNIX shells: C, Bourne, Korn, Bash, and tcsh; also covers three
main utilities in UNIX: grep (for searching), sed (for editing), and
awk (for scripting).
- UNIX in a Nutshell, A. Robbins, O'Reilly, 1999
- good general reference, contains alphabetized listing
of
core UNIX commands, and documentation on editors like Emacs, ex and vi,
among others
Miscellaneous
- One of the many links discussing scripting languages (WWW Journal, vol.2, spring '97)
- UNIX history as experienced by its creators: Dennis
Ritchie's
webpage