Summary

A few judiciously defined aliases can save you a lot of frustration down the road. Choose your favorite printer, define the PRINTER environment variable to point to that printer, and give yourself an alias such as print to include all the default options you like for your printouts. You might consider creating an alias pq to show your own print requests queued for your favorite printer. (This is easy to do. Use alias pq 'lpq $LOGNAME' or alias pq 'lpstat -u $LOGNAME'.) You also could show only your print requests, if any, by tucking a grep into the command: alias pq 'lpq | grep $LOGNAME'.

Get Sams Teach Yourself UNIX® in 24 Hours Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.