Skip to content

Latest commit

 

History

History
15 lines (9 loc) · 470 Bytes

print-from-the-command-line.md

File metadata and controls

15 lines (9 loc) · 470 Bytes

Print From The Command Line

Category: Linux

You can send a file to a printer from the command line on Linux using the versatile nc (netcat) command. Most printers expose port 9100 on the network.

For example, assuming a printer IP address of 192.168.1.128:

nc 192.168.1.128 9100 < /path/to/mydocument.pdf

Alternatively, use the printer name on the network or add an alias for it to your hosts file.

Note, the same command also works on macOS.