The Linux ACCEPT Command

What is Linux accept Command?

Explanation

Accept COMMAND:

The Linux "Accept" command allows you to extract the print requests for the named destination. The destination can be a printer or a class of printer. This command helps the user to submit print requests to the printer when a printer is processing a request. This helps the user to do maintenance work if any on the printer while the printer is accepting requests. In simple words, the Linux "Accept" command allows the print queue to accept printing job requests, while the printer is busy. This commands works only if you are a "ROOT" user or a "Sudo" user for root.

SYNTAX :


accept [ -E ] [ -U username ] [ -h hostname[:port] ] destination(s)

OPTIONS:


-E Forces encryption when connecting to the server.
-U Sets the username that is sent when connecting to the server.
-h hostname[:port] You can use hostname and port to connect to a remote server.
-r "reason" Sets the reason string that is shown for a printer that is rejecting jobs.

EXAMPLE:


  1. Here, a printer named HUAWEIMobile-Pcui is attached to your PC running Linux/Unix system. The steps to print a document is given below.
    enable HUAWEIMobile-Pcui
  2. To check the status of printer, run lpstat command:
    lpstat -a -p HUAWEIMobile-Pcui
  3. The output shown will be as follows:
    HUAWEIMobile-Pcui not accepting requests since Jan 01 00:00 printer HUAWEIMobile-Pcui is idle. enabled since Jan 01 00:00
  4. Use accept command to have the printer accept requests:
    accept HUAWEIMobile-Pcui
  5. Consider our printer is available on a server available remotely whose IP address is 192.168.1.1 and port is 631, then we will issue following accept command:
    accept -h 192.168.1.1:631 HUAWEIMobile-Pcui
  6. Now again use lpstat -a command :
    lpstat -a -p HUAWEIMobile-Pcui
  7. Now the output will be as follows:
    HUAWEIMobile-Pcui accepting requests since Jan 01 00:00

Ask Questions

Ask Question