Linux: How to start and stop printer queues

Q. How can I start and stop printer queues for printer called HPLJF2?

ADVERTISEMENTS

A. To stop/start printers and classes queues use enable (to start queue) command. There is also disable command to stop queue.

Linux Printer Control Command names

=> enable or cupsenable: To start the named printers or classes.

=> disable or cupsdisable: To stop the named printers or classes.

Task: Start a print queue

Type the following command to START a print queue for a printer called HPLJF2:
# /usr/bin/enable HPLJF2

Task: Stop a print queue

Type the following command to STOP a print queue for a printer called HPLJF2:
# /usr/bin/disable printer

Please note that use full path name for both commands. Otherwise you will end up running bash internal enable,which is use to enable and disable builtin bash shell commands.

Task: Verify queue is stopped or started

Use lpq command verify the queue is stopped or started:
# lpq

🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source/DevOps topics:
CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04

ADVERTISEMENTS
9 comments… add one
  • kylie Apr 30, 2007 @ 22:48

    I have some print queues that drop, I need a script that will check what queues are up and enable anything that is down, my scripting skills are not good enough to be able to setup and automated script. Does anyone have a script that will automatically restart downed print queues in aix 5.3

    • Dennis Apr 19, 2012 @ 21:31

      I’ve written scripts that will do this for AIX; they also will send e-mail or open a help-desk ticket for stalled queues or queues that can’t be restarted automatically. Let me know if you still need something like this (I know it’s been a long time since you posted).

      • Mohammed Fahad Apr 21, 2015 @ 4:28

        Dear Bro Dennis

        Kindly share that script., we have configured 200+ printers in AIX more of them are using HP Jetdirect and some of remote printer.,

        we need script to monitor print queue if down it should enable and send mail alert

        Thanks in Advance..
        Mohammed Fahad.

  • lakshmi prabha Feb 13, 2009 @ 7:04

    i want setting a print server in linux details.

  • me Jun 28, 2010 @ 16:42

    That would be simple. $1000 bucks and it’s yours.

  • ramamohan Feb 4, 2011 @ 19:59

    Hi,

    When we restart the print queue, were the jobs still available in the queue.

  • Diane Feb 27, 2011 @ 16:02

    This needs to be update the enable command doesn’t work for printing in RHEL 4 or RHEL 5 ???

  • p.nawin Feb 8, 2012 @ 6:18

    your website is not useful

  • Dave Jan 20, 2017 @ 17:55

    Is there a way to get cups to send a notification email when it disables a print queue? This is a sure sign something needs to be fiddled with, at least a paper jam.

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.