LPRM(1)

๐Ÿ’– LPRM โ€” the lprm(1) glow-up ๐Ÿ’–

ok so bestie, welcome to lprm, section 1 of the General Commands Manual. this is the manual page, and i'm gonna walk you through it like we're texting at 2am. grab a snack ๐Ÿ“


โœจ NAME โœจ

lprm โ€” remove jobs from the line printer spooling queue ๐Ÿ—‘๏ธโœจ


๐ŸŒธ SYNOPSIS ๐ŸŒธ

lprm [-] [-Pprinter] [[job# ...] [user ...]]

that's the whole vibe right there. short, iconic, does exactly what it says. ๐Ÿ’…


๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

okay so here's the tea: lprm will remove a job, or jobs, from a printer's spool queue. and here's why that matters โ€” the spooling directory is protected from users, so using lprm is normally the only method by which a user may remove a job. like, that's your one door. ๐Ÿ”‘

and who even owns a job? the owner is determined by the user's login name and host name on the machine where the lpr(1) command was invoked. so it's tied to where you were when you sent it, not where you are now. noted. ๐Ÿ“

๐ŸŽ€ Options and arguments:

  • -Pprinter โ€” specify the queue associated with a specific printer (otherwise the default printer is used). be specific, bestie.
  • - โ€” if a single - is given, lprm will remove all jobs which a user owns. and if the superuser employs this flag, the spool queue will be emptied entirely. ๐Ÿ‘‘ that's a lot of power, no cap.
  • user โ€” causes lprm to attempt to remove any jobs queued belonging to that user (or users). this form of invoking lprm is useful only to the superuser. ๐Ÿ™ˆ
  • job# โ€” a user may dequeue an individual job by specifying its job number. this number may be obtained from the lpq(1) program, e.g.,
% lpq -l

1st:ken                         [job #013ucbarpa]
       (standard input)        100 bytes
% lprm 13

see how we pulled 13 out of that [job #013ucbarpa]? that's the move. ๐Ÿ’…


if neither arguments or options are given, lprm will delete the currently active job if it is owned by the user who invoked lprm. it just... knows. ๐Ÿ”ฎ

lprm announces the names of any files it removes and is silent if there are no jobs in the queue which match the request list. so if it says nothing? that's not shade, that's just an empty match. ๐Ÿ˜ญ

and here's the lil behind-the-scenes moment: lprm will kill off an active daemon, if necessary, before removing any spooling files. if a daemon is killed, a new one is automatically restarted upon completion of file removals. so it's not gone-gone, it's just respawning. ๐Ÿ”ฅ


๐ŸŒˆ ENVIRONMENT ๐ŸŒˆ

if the following environment variable exists, it is utilized by lprm:

  • PRINTER โ€” if the environment variable PRINTER exists, and a printer has not been specified with the -P option, the default printer is assumed from PRINTER. โœจ

๐Ÿงš FILES ๐Ÿงš

  • /etc/printcap โ€” Printer characteristics file.
  • /var/spool/output/* โ€” Spooling directories.
  • /var/spool/output/*/lock โ€” Lock file used to obtain the PID of the current daemon and the job number of the currently active job.

๐Ÿ’€ DIAGNOSTICS ๐Ÿ’€

  • Permission denied โ€” Printed if the user tries to remove files other than his own. ๐Ÿšซ bestie, those aren't yours.

๐Ÿซถ SEE ALSO ๐Ÿซถ

lpq(1), lpr(1), lpd(8)

the whole friend group, fr fr. ๐Ÿ’œ


๐Ÿ‘‘ HISTORY ๐Ÿ‘‘

The lprm command appeared in 3.0BSD. an icon from the start, honestly. โญ


๐Ÿ˜ญ BUGS ๐Ÿ˜ญ

Since there are race conditions possible in the update of the lock file, the currently active job may be incorrectly identified. > โš ๏ธ so yeah, that's a real caveat โ€” sometimes it might point at the wrong job. not a vibe, but it's documented, so we move.


and that's the page!! ๐Ÿ’– this one's from the Debian crew, dated May 31, 2007 โ€” like, vintage, but the info still eats. go clear that queue, bestie. ๐ŸŽ€๐Ÿฆ‹โœจ

๐Ÿ“ฆ where this page comes from