linux print to printer 1

linux print to printer

#setup the printer, might not be required
#see avalaible printers
lpstat -p
#set the printer as printing destination
lpadmin -d [printer-name]
#check if the printer has been set as destination
lpstat -d


#print
lp /file-to-print

Here is what the above code is Doing:
1. lpstat -p lists all the printers available on the system.
2. lpadmin -d [printer-name] sets the printer as the default printing destination.
3. lpstat -d checks if the printer has been set as the default printing destination.
4. lp /file-to-print prints the file.

Similar Posts