print
PURPOSE
Enqueues a file.
SYNOPSIS
print -loc
print -backup -i [-Q dir[-N node]]
print -restore -i -u [-N node -Q dir][file...]
DESCRIPTION
The print command is a general purpose utility for
enqueing requests to a shared resource, typically a
printer device. With the print command you can enqueue
print requests, cancel a print requests, alter the pri-
ority of a print request, display the status of print
queues and devices, enqueue backup requests, enqueue
restore requests, and display the table of contents of a
backup. For information on how to establish default
print, backup, and restore queues, see Managing the AIX
Operating System.
To enqueue files on a specific queue, specify -queue. If
more than one device services a queue, you can also
request a particular device by specifying :device after
the name of the queue. If you do not specify a device,
the job is sent to the first available device. If you do
not specify a file, print copies standard input into a
file and enqueues it for printing.
Print requests may have operator messages associated with
them. This feature is useful in a distributed services
environment. The messages can be used to tell another
user who is operating the printer to load a special form
into the printer before allowing this job to print.
These messages are specified with the -of and -ot flags.
When qdaemon, the deamon that processes print requests,
is ready to begin a request that has an associated
message, the system displays the message on the console
of the machine where qdaemon is running. The text of the
message is accompanied by a prompt that tells the printer
operator how to signal the request to continue or cancel
the request.
Notes:
1. Before you can a print, backup, or restore a file,
you must have read access to it. To remove a file,
you must also have write access to the directory that
contains the file.
2. If you want to continue changing the file after you
issue the print command but before it is printed, you
must use the -cp flag.
3. When enqueuing files on a printer, flags and file
names can be interspersed in any order.
4. Blanks between flags and their arguments are not per-
mitted.
FLAGS
If you give print a list of file names, it enqueues them
all for printing on the default printer.
-ap=num Changes to num the priority of the named
file. The file must have been submitted
for printing prior to entering the print
command with this flag. See "-pr" on page
for a description of priorities.
-bp=num
-bp
-nb Controls the printing of burst pages
according to the value of num as follows:
0 Does not print headers or trailers.
1 Prints one header page before each file.
No trailer appears.
2 Prints a header page at the beginning
and a trailer page at the end of each
file.
The header stanza in the qconfig file
defines the default treatment of burst
pages.
Specifying only -bp is the same as speci-
fying -bp=2. Specifying -nb is the same as
specifying -bp=0.
-ca Cancels the printing of the named files.
-cp Copies the file. Ordinarily, to save disk
space, print remembers the name of the
file, but does not actually copy the file
itself. Use the -cp flag if you want to
continue changing the file while you are
waiting for the current copy to be printed.
-fi Causes print to act as a filter. The print
command automatically reads standard input
if you do not specify files as arguments.
However, if you do specify file arguments,
you can use the -fi flag to force print to
read standard input at the appropriate
time.
-nc=num Prints num copies of the file. Normally a
file is printed only once.
-no Notifies you when your job is finished. If
the -to flag is also used, print notifies
the user for whom the request is intended
(see the -to flag on page ).
-of=file Submits an operator message with a print
request. The specified file contains the
text of the message.
-ot=text Submits an operator message with a print
request. The specified text contains the
text of the message.
-pr=num Sets the priority of the named file to num.
Higher numbers assign higher priority. The
default priority is 15. The maximum pri-
ority is 20 for most users and 30 for the
users with superuser authority and members
of the system group (group 0).
-q Displays the status of the queues and
printers. The environment variable NLTIME
controls the appearance of the time field.
-rm Removes the file after it has been success-
fully printed.
-tl=title Puts title on the header page and displays
it when the -q flag is specified. Normally
the job title is the name of the file. If
print reads from standard input, the job
title is STDIN.# where # is the process id
of the print command.
-to=name Labels the output for delivery to name.
Normally the output is labeled for delivery
to the person issuing the print request.
In addition to the previous flags that are available to
all users, the print command accepts the following flags
when they are entered by users that have superuser
authority or users that are members of the system group:
-dd Turns off the device associated with queue.
The qdaemon no longer sends jobs to the
device, and entering "print -q" shows its
status as "OFF". Any job currently running
on the device is allowed to finish.
-dg[=node] Kills the qdaemon after all currently
running jobs are finished. Use of this
flag is the only clean way to bring the
qdaemon down. Use of the kill command may
cause problems, such as jobs hanging up in
the queue. If the qdaemon is on a remote
node, specify the node. You can specify it
as either a node id or nickname. If no
node is specified, the local node is
assumed.
-dk Acts the same as -dd, except current jobs
are killed. They remain in the queue, and
are run again when the device is turned on.
-du Turns on the device associated with queue.
The qdaemon sends jobs to it again and
entering "print -q" shows its status as
"READY".
Note: If more than one device is associ-
ated with a queue, you must specify the
device as well as the queue when you use
the -dd, -dk, and -du flags. Devices are
numbered, starting at zero, in the order
that they appear in the qconfig file. For
example, "-lp:0" designates the first
device on the lp queue. "-lp" designates
the same device only if there is no other
device on that queue.
-from=name Labels the output as though name had sub-
mitted it. You can only use this flag with
superuser authority.
-rr[=node] Forces the qdaemon to reread the qconfig
file after all currently running jobs are
finished. With this flag, a user with
superuser authority can change the qconfig
file without having to kill and restart the
qdaemon. If the qdaemon is on a remote
node, specify the node either a node id or
nickname. If no node is specified, the
local node is assumed.
-su=user Cancels or changes the priority on another
user's job when used with the -ca or the
-ap flags. For example, a job "report"
submitted by user "ann" can be cancelled as
follows:
print -su=ann -ca report
The print command passes flags it does not recognize to
the backend that does the printing. Thus, for each queue
there are flags not described above that can be included
on the print command line. See "piobe" for a list of
these flags.
EXAMPLES
1. To print a file on the default printer:
print memo
2. To print a file with page numbers:
pr prog.c | print
The pr command puts a heading at the top of each page
that includes the date the file was last modified,
the name of the file, and the page number. The print
command then prints the file.
3. To see if a file is still waiting to be printed:
print -q
This command displays the status of the queues and
printers. If a file has not been printed yet, then
it appears in the queue status listing. If you piped
data to print, as in Example 2, then it is listed as
"PRIMARY.OUTPUT".
4. To stop printing a file:
print -ca chapter1
This command cancels the request you made earlier to
print the file" chapter1". If the file is currently
being printed, then the printer stops immediately.
If the file has not been printed yet, then it is
removed from the queue so that it will not be
printed. If the file is not in the queue, print dis-
plays the message:
no such request from you -- perhaps it's done?
5. To disconnect a printer from the queueing system:
print -a:2 -dd
This command stops print requests from being sent to
the third printer that serves the "-a" queue. If a
file is currently being printed, it is allowed to
finish. You must be a member of the system group
(group "0") to run this command.
Note: The printers serving a given queue are num-
bered starting with zero in the order that they
appear in the /etc/qconfig file.
FILES
/etc/qdaemon Queueing daemon.
/usr/lpd/qdir/* Queue requests.
/usr/lpd/stat/* Information on the status of the
devices.
/usr/spool/qdaemon/* Temporary copies of enqueued
files.
/etc/qconfig Queue configuration file.
RELATED INFORMATION
The following commands: "backup," "piobe," "pr,"
"qdaemon," and "restore."
The qconfig file in AIX Operating System Technical Refer-
ence.
The discussion of print in Managing the AIX Operating
System.
The "Overview of International Character Support" in Man-
aging the AIX Operating System.