Open In App

accept command in Linux with Examples

Last Updated : 30 Jun, 2020
Improve
Improve
Like Article
Like
Save
Share
Report

In Linux, accept command is used to request the printer to start accepting print requests in the print queue for a named destination that could be a printer or a class of printer. It also enables the user to submit the print requests to the printer, even when the printer is not connected to the system. These requests can then be processed later using the accept command.

Syntax:

accept [ -E ] [ -U username ] [ -h hostname[:port] ] destination(s)
  • -E – causes the printer to accept requests by enabling the printer automatically.
  • -U – sets the username which is to be sent while connecting to the server.
  • -h – used to connect to a printer at a remote server

Executing accept command for the destination printer(HP-LaserJet-Professional-P1108), which is connected directly to the system.

Step 1. Get the current status of printer by using lpstat command.

lpstat -a -p HP-LaserJet-Professional-P1108

lpstat-command-linux

Step 2. Sending the request through accept command.

accept -E HP-LaserJet-Professional-P1108

request-through-accept-command

Step 3. Get the status again in order to check the request by accept command.

lpstat -a -p HP-LaserJet-Professional-P1108

check-request-accept-command

Now the print requests before the execution of the accept command, have been executed and now are not present in print queue.

To connect to a printer at a remote server.
Enter the following command to connect to a printer available at a server 120.10.100.100 and at port 631.

accept -h 120.10.100.100:631 HP-LaserJet-Professional-P1108

connect-printer-to-remote-server-using-accepts
Operation was failed here because no printer is currently available at the port mentioned. But if the printer would be connected then it will accept the request.


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads