V Lecture 3 — users, processes, emacs, scripting
V Shell review
V one line to remove all .log files in the current directory (rm *.log)
* what if rm has been aliased to rm -i? (rm -f *.log)
* copy the contents of a directory images to images_backup
(cp -r images images_backup)
* view a file many pages long (less)
* move two directories up (cd ../..)
* execute a program encode, have it use data.txt as stdin, and use use output.txt as stdout
(./encode < data.txt > output.txt)
* print a message on stderr (echo “ERROR” 1>&2)
* create a directory called model_results (mkdir model_results)
* suppress stdout while appending stderr
(time ./some_program > /dev/null 2>> logfile)
* nice overview of most of what we’ve covered:
http://freeengineer.org/learnUNIXin10minutes.html
V Users
V permissions
* chmod
* superuser
* ~
V Processes
V instance of a running program
* contains code, resources, state
* ps, top, kill
V Emacs
* files & buffers
* cutting & pasting
* scrolling & windows
V Scripting
V variables
V control flow
V for
* for var in list, for (( expr1; expr2; expr3 ))
V if, while
* test commands
V arithmetic expansion
V command substitution
* #!/bin/bash, chmod +x