Linux Sending files to printer
In Linux, you can send files to a printer using the lp
command, which is used to print files from the command line. Here's how to send a file to a printer:
- Check the available printers: Before sending a file to a printer, you need to make sure that the printer is available and configured correctly. You can check the available printers by using the
lpstat
command:
csslpstat -p
This will list all the available printers.
- Send a file to the printer: To send a file to a printer, use the
lp
command followed by the name of the file you want to print. For example, to send a file called "document.pdf" to the default printer, use the following command:
javascriptlp document.pdf
By default, the lp
command sends the file to the default printer. If you want to specify a different printer, use the -d
option followed by the name of the printer:
javascriptlp -d printername document.pdf
- Check the print queue: After sending a file to the printer, you can check the print queue to see the status of the job. Use the
lpq
command to display the print queue:
lpq
This will display a list of pending print jobs and their status.
- Cancel a print job: If you need to cancel a print job, use the
lprm
command followed by the job ID. For example, to cancel job number 3, use the following command:
lprm 3
This will cancel the print job.
Sending files to a printer in Linux is easy and can be done using the lp
command. You can specify the printer you want to use, check the print queue for the status of print jobs, and cancel print jobs if necessary using the lpq
and lprm
commands.
Comments
Post a Comment