CS 279 - Week 9 Lecture 1 - 10-16-12

*   the CS Club meets Mondays at 10 am in BSS 308
    you can sign up for its mailing list at
    humboldt.edu/clubs/club_sites/computer_science_club

*   two more diff options:
--------------------------
    -c - provides CONTEXT for the differences --
         it outputs 3 lines of context surrounding
         each difference

    -b - ignore trailing whitespace and treat sequences
         of whitespace as equivalent to a single blank

a little more about the wc ("wordcount") command:
-------------------------------------------------
*   counts the number of lines, words, and bytes
    in a file OR set of files

    by default, that is the order of those values

*   if you give more than 1 file,
    you also get a final line of output
    with the TOTAL number of lines, words,
    and bytes

    ...or if you put NO files, it uses standard
    input (so you CAN pipe to the wc command!)

    *  can use ^D to say you're ready for
       your standard input to be counted;

*   word here is defined as a nonempty sequence
    of characters delimited by whitespace
    
*   use the -c option to see just the number of bytesm
    use the -l option to see just the number of lines,
    and use the -w option to see just the number of
       "words"

    (but you can combine these, too)

touch
-----
*   touch "touches" a file, updating its access
    and modification times

*   IF the file doesn't exist, it creates it

tee
---
*   provides a way to capture the contents of a pipe
    without disrupting the flow of information
    through the pipe 

    ...named after a tee joint in plumbing...(sp?)

    tee filename...
    ...causes standard input to be copied both
       to standard output and to the file or files
       specified

    ls | tee looky | wc -l

    command1 | command2 | tee this | command3 | tee that | something
    *   here, this contains command2's output,
        and that contains command3's output;

    -a - append the output to each file instead
         of overwriting the file

    -i - ignore interrupts

find 
-----
*   find is used to locate files on a UNIX or Linux
    system;

    *   find will search any set of directories you
        specify for files that match the search
        criteria you specify

        (you can search by attributes such as
	 name, owner, group, type, permissions,
         date, and etc.!)

    *   note it IS recursive -- it WILL search
        all subdirectories, too;

    *   basic syntax:
    
        find where-to-look criteria what-to-do

        where-to-look defaults to .
        criteria defaults to none (select all files)
	what-to-do defaults to -print,
           which has the side-effect of displaying
	   the names of found files to standard output

(
find
..did not work on my mac, BUT
find . -print 
...prints ALL files, including in subdirectories,
   from the current directory
)