V Lecture 2 — more shell, streams, and poetry quest
V Announcements
V hw0 due tonight
* for hw0, cd Desktop only makes sense on a Linux VM
* office hours on webpage
V I/O streams
V every process has 3 standard streams
V input (stdin), file descriptor 0
* the keyboard by default
V output (stdout), file descriptor 1
* the screen by default
V error (stderr), file descriptor 2
* the screen by default
V redirect to files
* >, >>, 2>, 2>>, &>
* > — save output
* >> — generate a file line by line (e.g., as part of a loop)
* 2>, 2>>, &> — save errors, other info output to stderr (like time)
V redirect from files
* <, <<<
V redirect to other streams
* 2>&1
* command > 2>&1 file vs command 2>&1 > file
V redirect to other commands
* pipe: |
* ls /usr/bin | less
* du | sort -nr
V shell
* general form: command [options] [args]
V alias
* alias rm=rm -i
* .bashrc
V history search
* ctrl-r, grep ~/.bash_history
V * (globbing) -- more detail
* *.png -> all png files
* [abc]* -> all files whose names start with a, b, or c
* ls -l
V poetry quest
* wget http://courses.cs.washington.edu/courses/cse374/16wi/poetry_quest.tar
* tar -xf poetry_quest.tar
* readme file has instructions