Printing from a Unix Server

  1. Find the name of your printer. Ask your departmental tech partner or the lab operator for the name of the printer, or at the prompt, type lpstat -a.

    The resulting display will look something like this:

    ....
    fbac332 accepting requests since May 14 10:27 2001
    hplaser accepting requests since May 14 10:27 2001
    infoserv accepting requests since May 14 10:27 2001
    inst_laser accepting requests since May 14 10:27 2001
    ....

    The first word in each line will be the name of a printer. To see the entire listing in the window, include the |more switch with the lpstate -a command, for example lpstate -a |more. Use the space bar to advance one screen.

  2. At the prompt, type lp -dprintername filename where "printername" is the actual name of the printer you want to print to and "filename" is the actual name of the file you are wanting to print. Include the -d option to specify destination before the actual printer name. For example, to print a file called myfile.txt on the printer named hplaser, type lp -dhplaser myfile.txt

    lp accepts output directly from other programs and Unix commands. If you wish to print the output from a program or Unix command, you need not send it to a file first. The output from one program or command can be piped directly to the lp command. For example, ls -al | lp -dhplaser would send the output from the ls -al command directly to the hplaser printer.

Last Reviewed:

John Hughes

03/06/2012
5:32 pm

If I have no printers on my network, how can I add them?


Erin Griffin

03/07/2012
8:12 am

John, instructions for adding a printer to the network are here http://techarticles.uark.edu/printing/printing_networking_a_printer/. If you run into any problems, request support online at http://askit.uark.edu. Hope this helps!