LPQ(1)
๐ LPQ ๐
okay bestie, so this is lpq โ the spool queue examination program, from the General Commands Manual section of the Unix world. she's an icon, she's been around forever (more on that below ๐), and she's here to tell you what's cooking in your printer's queue. let's get into it ๐
โจ SYNOPSIS โจ
lpq [-al] [-Pprinter] [job# ...] [user ...]
๐ธ DESCRIPTION ๐ธ
so like, lpq goes and peeks inside the spooling area that lpd(8) uses to print files on the line printer, and then reports the status of the jobs you asked about โ or all the jobs that belong to a user. and if you just run lpq with zero arguments? she reports on any jobs currently in the queue. no filter, no fuss, just vibes ๐
the options are as follows:
-aโ report on the local queues for all printers, not just the one you specified. go big or go home โจ-lโ prints info about each of the files comprising the job entry. normally she only shows as much info as will fit on one line, so this is the โจ verbose โจ main character mode.-Pprinterโ pick a specific printer, otherwise the default line printer gets used (or whateverPRINTERis set to in the environment). and like, all the other arguments you pass get interpreted as user names or job numbers, filtering down to only those jobs you actually care about ๐ซถ
for every job that's been submitted (i.e., every invocation of lpr(1)), lpq reports:
- the user's name ๐ค
- current rank in the queue ๐
- the names of the files comprising the job ๐
- the job identifier โ a number you can hand to
lprm(1)to remove that specific job ๐ข - and the total size in bytes ๐
ngl, the job ordering depends on the algorithm used to scan the spooling directory, and it's supposed to be FIFO (First In First Out). supposed to be. anyway.
also โ file names comprising a job may be unavailable (this happens when lpr(1) is used as a sink in a pipeline), and in that case the file is just indicated as (standard input). mystery file energy, lowkey iconic ๐
๐จ iflpqwarns that there is no daemon present (i.e., due to some malfunction), you can use thelpc(8)command to restart the printer daemon. crisis averted, bestie.
๐ ENVIRONMENT ๐
if this environment variable exists, lpq uses it:
PRINTERโ specifies an alternate default printer.
๐ฆ FILES ๐ฆ
/etc/printcapโ to determine printer characteristics./var/spool/*โ the spooling directory, as determined from printcap./var/spool/output/*/cf*โ control files specifying jobs./var/spool/output/*/lockโ the lock file to obtain the currently active job.
๐ DIAGNOSTICS ๐
- unable to open various files.
- the lock file being malformed.
- garbage files when there is no daemon active, but files are still sitting in the spooling directory.
๐ SEE ALSO ๐
lpr(1), lprm(1), lpc(8), lpd(8)
โญ HISTORY โญ
lpq appeared in 3BSD. she's a legacy queen, no cap ๐
๐ญ BUGS ๐ญ
- due to the dynamic nature of the information in the spooling directory,
lpqmay report unreliably. it's giving "trust me bro" but for print queues. - output formatting is sensitive to the line length of the terminal, which can result in widely spaced columns. yeah. she's a little dramatic about your terminal width.
and that's the whole page bestie, fr fr ๐ง โ this one comes to you from Debian, dated May 31, 2007, and it lives in the LPQ(1) slot of the manual. go check your queue, slay ๐ โจ๐
๐ฆ where this page comes from
- debian bookworm: lpr 1:2008.05.17.3+nmu1
- debian trixie: lpr 1:2008.05.17.3+nmu3.1 ยท BSD-3-Clause
- ubuntu jammy: lpr 1:2008.05.17.3+nmu1
- ubuntu noble: lpr 1:2008.05.17.3+nmu1
- ubuntu questing: lpr 1:2008.05.17.3+nmu3.1
- ubuntu resolute: lpr 1:2008.05.17.4 ยท BSD-3-Clause
- ubuntu stonking: lpr 1:2008.05.17.4 ยท BSD-3-Clause
- Copyright (c) 1983, 1990, 1993 The Regents of the University of California. All rights reserved
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms