parent
server
search
trust
homes
|
Unix for the Intrepid
© 1997, 2003 C Alexander North-Keys, all rights reserved
Overview
This is the syllabus for a class taught in twelve four-hour sessions
spread over a three-week period.
Approximately eighty-five to ninety-five percent of the syllabus is covered
in a class, tailored somewhat to meet the students' interests.
Recommended Reading
- Unix for the Impatient, 2nd edition (reference)
- The Soul of a New Machine (historical, hardware)
- Hackers, by Stephen Levy (historical)
- Diamond Age, by Neal Stephenson (science fiction, computing concepts)
- The Tao of Programming (humor),
-
Further reading...
History, Purpose, Future, Features
- The flow of code
- MULTICS, UNICS, then UNIX...
- BCPL, B, NB, C, then diaspora...
- Flavors, including the AT&T and BSD variants
- UNIX, BSD, DARPA and the Internet
- MINIX to Linux
- User empowerment
- Development of the OS features
- Shared resources
- Kernel as a virtual machine
- Multitasking/multiuser/multiprocessing
- Virtual memory
- Internet services
- Advantages of remote access
- Interface progression
- Pre-Unix: Hollerith cards
- Printing teletypes
- Glass teletypes
- Intelligent terminals
- Bitmapped terminals and the XEROX PARC in the 1960s
- Suntools, the Macintosh, other early XEROX extrapolations
- NeWS, the NeXT, and X10 through X11R6
- Possibilities of the WWW, VRML, and OpenGL
- Research at XEROX PARC through the 1990s
- Textured windows in Mac OS X, c.2002
- Textured X (X Window System), c.2003
- Spatial interfaces
Initial Use of a Unix System
- Connecting
- Hardwired mainframe terminals
- Modem connections
- Internet connections (more detail later under Networking)
- rsh, rlogin, telnet, and their security concerns (briefly)
- ssh
- making an xterm in which to start a remote session with ssh
- xdm
- The console
- Virtual terminals
- Authorization
- login names, passwords, uids, gids, auxiliary groups
- selecting a login name, uniqueness
- login(1), su(1), sudo(1), sid(1,nonstandard), newgroup(1v,obsolete)
- selecting a password, obscurity
- passwd(1), chfn(1), chsh(1)
- Sessions, logging in, logging out
- Using the TERM environment variable
- Setting up the terminal
- stty(1) - setup the kernel teletype driver
- tset(1) - automate asking what kind of terminal one is using
- clear(1) - clear the terminal screen
- shell support for the control-L for clearing the screen
- Help
- the online manual - man(1)
- command syntax error messages
- command internal help
- desperation: using strings(1) to obtain syntax help
- the GNU info system
- the WWW and googling
- USENET newsgroups (now mostly overrun with spam)
- finding human assistance
The Directory Structure
- Tree metaphor
- Ancestry metaphor: parent and child directories
- Concept of inode, directory vs. other files
- Legal characters in filenames
- Exploring with cd(1), pwd(1), ls(1), more(1)
- Kind of pathnames
- Absolute (rooted, full)
- Relative
- Simple (no slash)
- Pathnames as references
- Tour - /bin /dev /tmp /etc /usr /mnt
- Home directories
- mkdir(1) - making new directories
- rmdir(1) - removing empty directories
- du(1) - check directory space usage
Files
- Common types
- normal
- configuration files
- executable files
- READMEs
- dotfiles
- directory
- character special
- block special
- link
- pipe
- socket
- ls(1) - list info about files, &c, BSD and SVr4 options
- file(1) - try to determine the filetype by its contents
- what(1), ident(1) - special information in SCCS and RCS files
- Viewing files with cat(1), more(1), pg(1sysv), and less(1)
- touch - create empty files
- Copying and moving/renaming files
- cp(1) - copy files and directories
- multiple file copies and the target directory
- the BSD trailing-slash convention and its weaknesses
- mv(1) - move (rename) files and directories
- moving multiple files and the target directory
- copying directories with the -r option
- problems with cp -r, comparison to tar(1)
- moving directories
- moving things between filesystems
- Removing files and directories
- hazards of removal, permanency, typing errors
- rm(1) - remove files
- rm -rf - remove whole directory hierarchies
- principles of shell-level wrappers around rm(1)
- Changing Inode data
- chown(1) - change ownership, security & quota issues
- chgrp(1) - change group
- chmod(1) - chmod mode and permission, octal and symbolic
- chattr(1) - extended file attributes under linux-like systems
- ln(1)
- hardlinks vs symbolic links
- creating new hardlinks
- creating new symbolic links with the -s option
- quirks of symbolic link permissions
- Creating specials and pipes with mknod(1)
Shells
- Interface between user and kernel
- Shells as programming languages
- Writing Unix shells
- Existing Unix shells
- Bourne at AT&T
- sh - programming
- jsh - job control
- ksh - command edit
- Csh at Berkeley
- csh - history
- tcsh - command edit
- Plan9 at AT&T
- rc - lisp-like
- es - extensible
- Hybrids
- bash - GNU's ksh/csh superset
- zsh - ksh/csh superset
- Other metaphors
- ash - the adventure shell
- Graphic interfaces
- Shell configuration
- configuration files, backwards compatibility
- env(1), set(1), vars(1rc), echo(1), shopt(1,bash)
- local vs exported variables
- setting local and environmental variables
- Specific environment variables
- PATH - the command search path
- finding command directories to add
- dangers of having "." too early in the path
- MANPATH - the manual search path
- finding manual directories to add
- PAGER - customizing the viewing of long files
- TERM - setting with tset(1) or directly
- CDPATH - search path for cd, in shells with support it
- LD_LIBRARY_PATH and kindred
- setting the prompt string, $PS1 or $prompt
- reloading the environment
- functions, aliases
- problems caused by masking system programs
- Command Syntax
- command names and arguments
- multiple commands on a line using semicolons
- input/output redirection
- background jobs with ampersand
- pipelines
- using tee(1) in pipelines
- delayed execution with sleep(1)
- exit status and how to see it
- using filters and sponges
- substitution and rewrite
- $ - variable
- ``, $() - output
- ~ - tilde, home directory
- ! - history
- \, '', "" - quoting to prevent certain substitutions
- filename wildcards
- * - any number of any character
- ? - one of any character
- [] - one of a set of characters
- [abcd] - sets
- [a-d] -ranges
- [A-Za-z_-] - combined sets and ranges
- [^0-9] - invert sets
- special treatment of . in dotfiles
- {} - filename expansion
- filename expansion to produce wildcards
- process substitution (in bash and zsh) with <(cmd)
- Editing command lines
- the kernels teletype-driver interface
- history substitution
- commandline edit in Emacs mode
- Job control in the Csh family
- jobs - list jobs, and process ids with -l
- kill - using named signals, and % with job ids
- bg - make a job resume in the background
- fg - make a job resume in the foreground
- using control-z to suspend foreground jobs
- Programming constructs in the Bourne shell family
- do, done
- for
- true, false
- if, then, elif, else, fi
- case, esac
- the null command using a colon
- shell scripting and the user's own bin directory
- scripts vs functions/aliases
- writing a program which counts from 1 to 100
- getting input with read
- Programming with Unix system commands and idioms
- slowing loops using sleep(1)
- test(1) and its other name, [(1)
- expr(1)
- comparison between expr(1) and bc(1)
- free input handling using cat(1)
- verifying input with grep(1)
- Creating shell scripts
- adding $HOME/bin to PATH in the ~/.profile or equivalent
- placing script files in the ~/bin directory
- the interpretor line
- shell code
- ensuring the final newline with comments
- setting the execute bit with chmod(1) and -x
Processes
- Concept of a process
- Fork-and-Exec process creation
- How a shell...
- runs a given command and waits for it
- runs a given command in the background with &
- does input/output redirection
- sets up pipelines
- Inheritance from the parent
- user, group, and auxiliary group ids
- input/output descriptors, example made of getty(1)
- environment
- Process control
- priority - nice(1), renice(1)
- signaling - kill(1), and its -l option
- resources - ulimit(1sh)
System Status and Account Information
- Commands you can only run on yourself
- whoami(1), logname(1) - find your username
- quota(1) - are you over your file quota?
- id(1) - output your current access rights
- tty(1) - find your terminal's device file
- Getting info about other accounts
- w(1), who(1), finger(1) - find who's logged in
- last(w) - who's been logged in historically
- fingering other users
- fingering another machine's users
- groups(1) - find a user's group access rights
- Time
- the TZ variable
- date(1) - output the current time in sundry formats
- uptime(1) - how long the machine's been up, and the load
- ntpq(8) - cordination with Universal Time
- System activity
- ps(1) - what processes are running, BSD and SVr4 variants
- lastcomm(1) - list programs people have been running
- netstat(1) - current network connections
- df(1) - filesystem list and current disk usage
- top(1) - topmost active process list, time, and memory stats
-
Editors
- Buffered editors vs. stream and direct editors
- Line editors vs. character editors
- Ed
- history
- basic editing capabilities, using: . $ p a i w q d
- cautions, getting more descriptive errors with H
- in-place editing through careful scripting
- the q, w, q sequence
- comparison with: perl -pi -e '....'
- Vi
- history
- basic editing capabilities, HJKL, etc.
- modality
- cautions and recommended practice
- vilearn(1)
- comparison with newer versions
- Emacs
- history
- basic editing capabilities, using Control and Meta, etc.
- modality
- cautions and recommended practice
- the emacs tutorial
-
- Filters vs sponges and immediacy of output
- Basic filters
- tr(1) - translate or delete characters
- grep(1) - selecting lines
- uniq(1) - removing and counting repeated lines
- nl(1) - number lines in a file
- bc(1) - esoteric uses of the basic calculator
- cut(1) - keeping only certain character-columns
- rev(1bsd) - reverse lines left-to-right
- head(1), tail(1) - retain only beginning or end of output
- using compression programs in filter mode
- Sponges
- sort(1) - sorting lines, possibly numerically
- Programmable filters
- sed(1) - stream editor, string replacement
- awk(1) - interpreted language, accessing fields
- perl(1) - interpreted language, full-featured
- m4(1) - a hairy macro language
Communications
- Realtime interuser communications
- writing text directly to a terminal device file
- using mesg(1) and write(1)
- talk(1) and ytalk(1tal)
- irc(1) - Internet Relay Chat
- Electronic mail
- Addressing
- within a site
- uubang addressing
- Internet addressing
- determining your own email address
- finding someone else's email address
- name uniqueness
- using address search sites like www.four11.com
- aliases, .forward file, and the vacation(1) program
- contacting a site's Postmaster
- Transmission and access
- SMTP - simple mail transfer protocol
- message forgery under SMTP
- POP - pop office protocol
- IMAP - Internet message access protocol
- security problems due to cleartext transmission
- better security through mechanisms such APOP and IMAPS
- web-based access to server-side IMAP manipulation
- Composition and reading
- traditional - mail(1), biff(1)
- the Rand MH mail system
- graphic user agents
- POP agents and how to configure them
- filing mail, including the filing of outgoing mail
- signature files
- computer-to-human email communications and mail(1)
- MIME - multimedia Internet mail extension
- Mailing lists and majordomo(8)
- Security
- misaddressing and misdirection
- spam and mailbombs
- spam reduction
- email address concealment
- sendmail /etc/mail/access database configuration
- spam sender verification using traceroute
- the Realtime Blackhole List
- spamassassin
- problems with reverse spamming
- using PGP - pretty good privacy
- USENET News
- genesis of the USENET news system
- NNTP - network news transmission protocol
- finding an NNTP newsserver
- reading news via an NNTP client program
- group overview, special status of alt.*
- normal and moderated groups
- signal-to-noise ratios
- why the WWW has largely supplanted USENET
Utilities
- find(1), xargs(1)
- selecting a starting directory
- the -print directive
- locating anything matching a name or (quoted) wildcard
- locating only certain types of files
- locating files owned by particular a user or group
- locating files of a certain age
- using find(1) in combination with xargs(1) and other commands
- wc(1) - count words, lines, and characters in files
- diff(1), diff3(1) - find differences between text files
- comm(1) - find common and unique lines in a pair of sorted files
- cmp(1) - comparing binary files
- cal(1) - output a calendar
- od(1) - octal dump
- join(1) - join files into columns
- yow(1), fortune(1) - text generators
- vacation(1)
- units(1) - conversions
- script(1bsd) - make typescript of terminal session
- spell(1), ispell(1gnu) - spelling checkers
- look(1) - lookup words or lines in a file by prefix
- strings(1) - dig readable strings out of a binary file
- leave(1) - remind yourself to leave the computer
- whois(1) - find Internet-significant persons
- sum(1) - summarize a file into a checksum
Document Formatting and Printing
- Comparison of markup, languages, and WYSIWYG editors
- Basic formatting
- fold(1), fmt(1) - wrap text to a certain line maximum
- pr(1) - paginate
- Languages
- The ROFF document formatting package
- nroff(1), troff(1), groff(1) - typeset
- deroff(1) - remove Roff typesetting codes
- col(1) - remove char-sequence that confuse terminals
- TeX and LaTeX
- PostScript
- Markup
- HTML - hypertext markup language
- SGML - standard generalized markup language
- XML - extensible markup language
- WYSIWYG
- FrameMaker - document typesetting in WYSIWYG form
- HTML editors - what you see is -all- you get
- Printing
- Translating documents to understood printer format
- BSD: lpd, lpr, lpc, lpq, lprm, /etc/printcap
- SYSV: lp, enable, cancel
Spooling
- Overview of spooling and related directories
- Services using spooling
- Printing
- News
- Email
- Paging (on applicable systems)
Software Development
- Overview of the programming process
- Machine language
- Assembly language and assemblers - as(1)
- Human-readable languages and compilers - cc(1), cpp(1)
- Linking - ld(1)
- Superlanguages - yacc(1), lex(1) (or bison(1gnu) and flex(1gnu))
- Debuggers and core dumps - dbx(1), gdb(1gnu)
- Source management and editing
- special modes in Emacs for editing source code
- indent(1), vgrind(1) - source formatters
- make(1)
- SCCS(1), RCS(1), and CVS(1)
- patch(1) and context diffs made with diff(1) and -c3
- cxref(1) and cflow(1)
- Investigation of compiled code (machine code)
- ldd(1) or elfdump(1sgi)
- strings(1)
- nm(1)
- Investigation of running code
- ps(1) to get the process id
- trace(1), SGI's strace(1), or Linux' ptrace(1)
- debugging running code with dbx(1), gdb(1gnu) or xxgdb(1gnu/x)
- the /proc filesystem
- Special issues related to system kernel configuration
- configuring a kernel to machine system hardware
- configuring a kernel for certain software capabilities
- configuring a kernel to allow for usage or optimizations
- rebuilding a system
- holding a backup kernel
- historical move toward more flexible and dynamic kernels
- kernel debuggers - adb(8)
Software Importation and Compilation
- Where to get software on the Internet
- The benefits of source code
- Acquiring source code
- finding software on the WWW
- finding software using archie(1)
- using ftp(1) to transfer files to your computer
- unpacking the distribution
- shar(1), unshar(1) - shell archives
- Compiling source code
- finding the README and INSTALL files
- GNU project software and ./configure
- X software and xmkmf(1)
- using make(1) directly
- editing Makefiles
- editing sourcecode
- final installation
- Making distributions with tar(1) and gzip(1)
Compression and Archival
- pack(1v), unpack(1v)
- compress(1), uncompress(1)
- gzip(1gnu), gunzip(1gnu)
- zcat(1) - generalized program for decompressing to stdout
- ar(1) - archiver
- tar(1) - tape archiver
- problems with older tar(1) implementation and SGI's bru(1)
- Storage formats
- tape - paper, reel, QIC, 4mm, 8mm, DLT
- other - CDROM burning, removable disk media
- manipulating tapes with mt(1)
- purging spurious files before archival with find(1)
Encryption
- conventional
- rot13
- substitution
- DES
- one-time pads
- modern approaches
- public key encryption with PGP - pretty good privacy
- private key
- public key
- key ring
- encryption
- decryption
- signatures
- integration with electronic mail
- risks of public-key escrow systems
Networking
- Unix networking
- Pre-Internet
- issues of intermittent connectivity and resource contention
- modem-type hardware
- nodenames
- cu(1), tip(1), and the unix-to-unix command set
- sz(1), rz(1) - Zmodem communication over old-style phone links
- Internet
- issues of continuous connectivity
- networking hardware
- ifconfig(8) - display/find network local interfaces
- likely connected hardware and uplinks
- modems vs. ISDN vs. T1/ADSL, etc.
- IP addresses
- ping(1) and traceroute(1)
- hostnames
- domainnames
- DNS - domain name service
- the old hostlist on sri-nic.arpa, later nic.ddn.mil
- problems encountered with increased Internet size
- DNS servers and specifying them in configuration files
- nslookup(1) for IP addresses
- other nslookup commands
- routing
- how routing works
- default routes and specifying them in config files
- ftp(1) and the ~/.netrc
- telnet(1)
- rlogin(1), rsh(1), rcp(1), and the ~/.rhosts file
- ruptime(1), rup(1), rusers(1), rwall(1), rwho(1)
- issues of packet visibility and security concerns
- ssh(1), scp(1), and the ~/.ssh/ directory
-
Administration
- Principles of systems administration
- The root user
- Authentication - passwd(1), passwd(5), group(1), login(1)
- Halting - shutdown(8), halt(8), reboot(8), init(8)
- Understanding SCSI - small computer systems interface
- the SCSI bus and device count limits
- SCSI-1 through SCSI-3
- fast, wide
- uses for fast wide SCSI
- single-ended vs differential
- advantages of multiple SCSI busses
- Disks
- format(8), SGI's fx(8)
- disk labels and partitions
- stupid BIOS limitations and virtual partitions
- subdevices and limits on SCSI drives
- reasons for using partitions
- risk reduction vs block failure
- damage containment
- partitions as backup units
- speed issues when used for swap
- politics
- unix filesystem formats
- journaled filesystems such as XFS (on SGI), an EXT3 (on Linux)
- newfs(8), mkfs(8)
- mount(8), umount(8)
- filesystem exportation
- Terminals - ttys(5), ttytab(5), termcap(5), terminfo(5)
- wall(1)
- Message of the Day - /etc/motd
- Accounting - sa(8)
- Unix runtime commands - /etc/rc*
- The problem of a lack of dependency checks in the /etc/rc subsystem
Power Users
- Group-sharing of files and directories using chgrp(1) and chmod(1)
- Scheduling - crontab(1), at(1)
- mkfifo(1), mknod(1), and the use of FIFO pipes
- find(1) and the -o and -prune options
- Heterogeneous networks and the command search path
- Heterogeneous networks and effects on configuration files
- Setting up configuration files for multiple shell types
- screen(1) - using detachable sessions
- rdist(1)
- Controlling processes remotely using kill(1) with SIGSTOP
- Interfacing with wireless alphanumeric paging devices
|
Walk without rhythm and you won't attract the worm.
[
Your browser's CSS support is broken.
Upgrade!
]
|