Open In App

accept command in Linux with Examples

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)

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

Step 2. Sending the request through accept command.

accept -E HP-LaserJet-Professional-P1108

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

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

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


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.

Article Tags :