lpstat -sLaptop users find this next command particularly helpful, as it tells them how they access the printers available to them. When you first set up a printer, you must specify how you connect to it. You have several choices:
To find out what printers are configured for your computer and how you connect to those printers, use lpstat with the -s option. $ lpstat -s system default destination: bro device for bro: socket://192.168.0.160:9100 device for bro_wk: socket://192.168.1.10:9100 device for wu: socket://128.252.93.10:9100 In this case, every printer is a network printer, so it uses socket://, followed by the printer's IP address and its port (9100 is standard for most networked printers, although you might see port 35 used as well). That's pretty easy, but it can quickly get much more complicated. Although CUPS is user-friendly in many areas, it's famously obtuse when it comes to the Uniform Resource Indicators (URIs) used to indicate the locations of printers vis-à-vis your Linux box. Table 6.1 lists each connection method and the type of URI you might see, which should help you understand the list of printers and URIs you see when you run lpstat -s. Note Assume that the printer in the following examples is named bro and located on the network at 192.168.0.160. That isn't relevant in every situation, of course. If the printer is connected via a parallel cable, its IP address doesn't matter.
Thanks to the rise of network printing in the past several years, it's getting simpler to connect to printers via socket, ipp, or http. Even so, you're still going to run into legacy printers that require the older, more complicated connection methods, so it's good to familiarize yourself with them. Tip A bonus is that lpstat -s in essence duplicates the functionality of lpstat -p -d, as it lists all printers known by your system, as well as the default printer. If you want to know all that information quickly, this is a good command to use. |