![]() ![]() ![]() You may need to manually install CUPS, and lpr itself, to print this way. lpd is a legacy piece of software for Linux, but it is supported under the modern system used by most Linux distributions, CUPS (the Common Unix Printing System). The way lpr works, in a nutshell, is: it reads in the file and hands the printable data over to the linux printing daemon, lpd. And most importantly, it lets you access the printer device without being the superuser. Lpr is much more user-friendly than this, however, and it lets you queue print jobs. Only the superuser can write directly to the printer device, which is why we have to preface the command with sudo. Normally cat sends its output to standard output (the terminal) but here we redirect it to the device /dev/lp with the > operator. Your printer may be another device name, for instance lp0. This name is a symbolic link to the device, and may vary. What this command does is read the file my-file-to-print.txt and send it, byte by byte, to the printer device /dev/lp. The simplest way to print in Linux is to cat a file to the printing device, like this: sudo cat my-file-to-print.txt > /dev/lp If no files are listed on the command-line, lpr reads the print file from the standard input. ![]() Files named on the command line are sent to the named printer (or the default destination if no destination is specified). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |