A Unix Primer 317
lpr file Print file on default printer
lpr -Pseftalia file Print file on printer named seftalia
lpr -cnfile Printncopies
lpr -d file Interpret file as a device-independent (dvi) file
lpq Show printing queue on default printer
lpq -Pseftalia Show printing queue on printer named seftalia
lprm # Remove print request # listed with lpq
Table A.4 Unix printing commands.
ps List processes and identification numbers (pid)
jobs Report current jobs and job id numbers
ctrl-c Terminate an active job
ctrl-z Suspend an active job
kill pid# Terminate an active process
history Show session history
!1958 Repeat command with history number 1958
!str Repeat last command beginning with string str
!! Repeat entire last command line
!$ Repeat last word of last command line
man command Display manual for a command
man -k string List one-line summaries of manual pages
containing the string
alias ouzo command Abbreviate command to: ouzo
? Single-character wild card
* Arbitrary number of characters wild card
command>file Direct output of command to file instead of
the standard output (screen), replacing content
command>>file Output is appended to the current contents
command<file Command receives input from file instead of
the standard input (keyboard)
cmd1|cmd2 “Pipe” (send) output of cmd1 to input of cmd2
script file Log everything displayed on the screen to a file;
end withexit
date Display date and time
hostname Display the computer name
ping goulis Probe computer goulis on the Internet
users Show logged-in users
env Display the environmental variables
Table A.5 Miscellaneous Unix commands.