Print a file or modify a queued print job
lp command is used to print files or modify queued print tasks. Similar to the lpr command, the lp command supports both file input and standard input. It differs from lpr in that it has a different (slightly more complex) set of parameter options.
lp(option)(parameter)-E: Force encryption when connecting to the print server;
-U: Specify the user name used when connecting to the print server;
-d: Specify the target printer to receive the print task;
-i: Specify an existing printing task number;
-m: Send E-mail when printing is completed;
-n: Specify the number of copies to print;
-t: Specifies the name of the print task;
-H: Specify the time when the print task starts;
-P: Specify the page number to be printed.File: File to be printed.
To print the file /etc/motd on printer lp0 attached to device dlp0, enter:
lp /etc/motdTo print 30 copies of the /etc/motd file using one copy of the file, and to notify the user by email that the job is complete, enter:
lp -c -m -n30 -dlp0:lpd0 /etc/motdTo print the /etc/motd file using the backend flags -f and -a with a job title blah, enter:
lp -t "blah" -o -f -o -a /etc/motdTo queue a MyFile file and return the job number, enter:
lp myfileTo queue a MyFile file and suppress job numbers, enter:
lp -s myfileExit status
The command returns the following exit values: