Visit Our UNIX and Linux User Community

Linux and UNIX Man Pages

Test Your Knowledge in Computers #950
Difficulty: Medium
The first academic work on the theory of self-replicating computer programs was done in 1949 by Alan Turing.
True or False?
Linux & Unix Commands - Search Man Pages

lpq(1) [bsd man page]

LPQ(1)							      General Commands Manual							    LPQ(1)

NAME
lpq - spool queue examination program SYNOPSIS
lpq [ +[ n ] ] [ -l ] [ -Pprinter ] [ job # ... ] [ user ... ] DESCRIPTION
lpq examines the spooling area used by lpd(8) for printing files on the line printer, and reports the status of the specified jobs or all jobs associated with a user. lpq invoked without any arguments reports on any jobs currently in the queue. A -P flag may be used to spec- ify a particular printer, otherwise the default line printer is used (or the value of the PRINTER variable in the environment). If a + argument is supplied, lpq displays the spool queue until it empties. Supplying a number immediately after the + sign indicates that lpq should sleep n seconds in between scans of the queue. All other arguments supplied are interpreted as user names or job numbers to filter out only those jobs of interest. For each job submitted (i.e. invocation of lpr(1)) lpq reports the user's name, current rank in the queue, the names of files comprising the job, the job identifier (a number which may be supplied to lprm(1) for removing a specific job), and the total size in bytes. The -l option causes information about each of the files comprising the job to be printed. Normally, only as much information as will fit on one line is displayed. Job ordering is dependent on the algorithm used to scan the spooling directory and is supposed to be FIFO (First in First Out). File names comprising a job may be unavailable (when lpr(1) is used as a sink in a pipeline) in which case the file is indi- cated as ``(standard input)". If lpq warns that there is no daemon present (i.e. due to some malfunction), the lpc(8) command can be used to restart the printer daemon. FILES
/etc/termcap for manipulating the screen for repeated display /etc/printcap to determine printer characteristics /usr/spool/* the spooling directory, as determined from printcap /usr/spool/*/cf* control files specifying jobs /usr/spool/*/lock the lock file to obtain the currently active job SEE ALSO
lpr(1), lprm(1), lpc(8), lpd(8) BUGS
Due to the dynamic nature of the information in the spooling directory lpq may report unreliably. Output formatting is sensitive to the line length of the terminal; this can results in widely spaced columns. DIAGNOSTICS
Unable to open various files. The lock file being malformed. Garbage files when there is no daemon active, but files in the spooling directory. 4.2 Berkeley Distribution June 5, 1986 LPQ(1)

Check Out this Related Man Page

lpq(1)							      General Commands Manual							    lpq(1)

NAME
lpq - Examines the spool queues. SYNOPSIS
lpq [+] [number] [-l] [-Pprinter] [request-ID...] [user...] OPTIONS
Displays information about each of the files comprising the printer request. Specifying printer displays requests queued for that printer only. Displays the spool queue until it empties. Sleeps number seconds between scans of the queue if number is specified. DESCRIPTION
The lpq command examines the spooling area used by lpd for printing files on the line printer and reports the status of the specified requests or all requests associated with a user. The lpq command invoked without any arguments reports on any requests currently in the queue. The -P option can be used to specify a par- ticular printer; otherwise, the default line printer is used (or the value of the PRINTER environment variable). Specifying one or more request-IDs displays only the specified requests. Specifying one or more users displays print requests from those users only. If you specify the + argument, lpq displays the spool queue until it empties. Supplying a number immediately after the + argument indi- cates that lpq should sleep number seconds in between scans of the queue. All other arguments supplied are interpreted as user or request- ID arguments to display only those requests of interest. For each request submitted (that is, each request invoked by lp or lpr), lpq reports the user's name, current rank in the queue, the names of files comprising the request, the request ID (a number that you can use to identify the request to other commands, such as lprm) and the total size of the job in bytes. The -l option causes information about each of the files comprising the request to be displayed; without it, only as much information as will fit on one line is displayed. Job ordering depends on the algorithm used to scan the spooling directory and is supposed to be FIFO (First In First Out). Filenames comprising a request might be unavailable (when lp or lpr is used as a sink in a pipeline), in which case the file is indicated as follows: standard input NOTES
Due to the dynamic nature of the information in the spooling directory, lpq might report unreliably. Output formatting is sensitive to the line length of the terminal and can result in widely spaced columns. DIAGNOSTICS
Appropriate diagnostic messages appear under several conditions: If there is no daemon active, but there are files in the spooling direc- tory, the message Warning: no daemon present is displayed. If the network is unreachable, the message connection to device is down is dis- played. If the printcap file is unavailable, the message lpq: device cannot open printer description file is displayed. If the spooling directory is unavailable, the message lpq: device cannot chdir to spooling directory is displayed. EXAMPLES
To display a request in the print queue, enter: lpq -Pprinter1 This command displays a list similar to the following: Mon March 2 15:15:15 1990: printer1 is ready and printing Rank Pri Owner Job Files Total Size active 0 rcb 888 massachusetts 1024 bytes 1st 0 jmp 110 berkshire 2048 bytes (Output may be formatted differently on your system.) An appropriate message is displayed if the lock file is malformed. FILES
Manipulates the screen for repeated display. Printer description file. Spool directories. Daemon control files. Data files specified in cf files. Temporary copies of cf files. Lock file used to obtain the process ID of the current daemon and the request ID of the currently active request. SEE ALSO
Commands: lp(1), lpc(8), lpd(8), lpr(1), lprm(1), lpstat(1) lpq(1)

Featured Tech Videos