UNIX and Scripting

School of Visual Arts, MFA Computer Art
Spring 2008
Instructor: A. Deck
 

Unix Topics

Overview

Basic System Usage
  • Shells
  • Overview of UNIX operating system

Directory/Filesystem Layout

  • files, directories, directory structures
  • home directory vs. working directory
  • paths: absolute and relative

Basic commands

  • filesystem navigation: cd, ls, pwd
  • file manipulation: cp, mv, rm
  • basic wildcards (*, ?)
  • online documentation (man)

File Creation/Editing/Displaying

  • echo, cat, more, head, tail
  • jot, vi
  • diff

File Parsing/Manipulation

  • grep, sed, sort, uniq, cut
  • awk

Redirection/Pipes

  • stdin (<), stdout (>, >>), stderr (>&, >>&)
  • pipes (cmd1 | cmd2 | cmd3)
  • tee and |&

Command history

  • history
  • !!, !$, !4, !jot, ^sdf^sde

Machine Environment

  • telnet, rlogin, rsh, rcp, ssh, scp
  • df, du
  • ps, top, who
  • osview
  • hostname, date
  • compress, uncompress, gzip, gunzip

User Unix Environment

  • .bashrc, .alias, .login, source command
  • alias, unalias, env
  • environment variables, path, setenv
  • rehash, which

Shell Scripts

  • #!/bin/bash
  • command line parsing: argv, argc, $argnum
  • bc
  • commenting
  • exit

Variables, Loops and Conditionals

  • variables: $ representation, arrays, set, @ (integer math for variables)
  • evaluation of conditions - true/1, false/0, && (and), || (or), ! (negation)
  • `cmd` for variable setting, foreach loops, etc.
  • if, foreach, while

Job control

  • jobs, &, ctrl-z, ctrl-c, bg, fg
  • sleep, at
  • kill, killall

Back-ups

  • tar

Image Utilities

  • image formats, channels and bit depth, sequence numbering, etc.
  • fcheck, file, xv
  • Image Utilities and NetPBM