UNIX Major metaphors: * files everything is a file. (your program, your mouse, ...) * piping take output form one program and make it the input for another. Interface: * shells a shell is just a program that reads user commands and executes them, 'exec' system call. ------ Shells (tcsh): * globing matching expressions args.sh *.txt args.sh i*.txt args.sh * ~ * escaping passing * or other special char to a program args.sh \* \~ * quoting grouping arguments and quoting special chars (slide 17) args.sh "hello world!" args.sh "my $HOME" args.sh 'my $HOME' * path Where programs are looked for. echo $PATH * env Enveronment variables setenv EDITOR emacs echo $USER env * alias Add a command alias alias alias edit emacs alias lj 'ls *.java' alias ll 'ls -l' ------ Getting Around: * pwd Print Working Directory * ls List ls ls *.java ls -l ls -a (note . and ..) ls -F * cd Change Directory: cd cd /usr/bin cd ~hartline/TA/UNIX-Emacs/ cd .. ------ Dealing with files: * cat Concatinate: concatinate 1 or more files cat UNIX.txt cat *.txt * head/tail Head/Tail: show the beginning/end of a file head UNIX.txt tail UNIX.txt head -1 UNIX.txt * more(less/most) Page through file with prompt more UNIX.txt * grep Search files for regular expression grep UNIX UNIX.txt * mkdir Make Directory mkdir my-dir * cp Copy File(s) cp *.txt my-dir cp UNIX.txt intro.old * mv Move/Rename Files mv intro.old intro.very-old mv intro.very-old my-dir * rm Remove File: rm *.o rm -r my-dir ------ Piping (tcsh): * From file cat < UNIX.txt * To file: echo "hello world" > foo.out * Between Programs: cat *.txt | grep UNIX * Grouping (echo hello; echo world) > bar.out * Appending echo hello again >> foo.out * Command Substitution args.sh `cat foo.out` ------ Shell Variables, etc (tcsh): * autolist * path (which) * noclobber * autologout * examples unset noclobbor set autolist set path = ($path /uns/bin) Command History (slide 27) * !5 * !! * ^P/^N * arrow keys * history Shell Startup (slide 10): * .login * .cshrc ------ Jobs: * fg/bg * ^Z * jobs * ps * kill * nice ------ More Sources For Information: * man pages man ls man -k perl * info info make info gcc (from emacs) M-x info * ToolsTalks Slides http://www.cs.washington.edu/uns/ToolsTalks/