aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorJohannes Stoelp <johannes.stoelp@gmail.com>2024-08-28 00:23:54 +0200
committerJohannes Stoelp <johannes.stoelp@gmail.com>2024-08-28 23:16:36 +0200
commitdc3c197e2c96184f87d3bfe2638e8e013f7ccd5e (patch)
treee444f6b55935b1fd592d98fa965c6bea65ff63e2 /src
parent014963008a43808119d9d6c56bbbd1692a4bcb27 (diff)
downloadnotes-dc3c197e2c96184f87d3bfe2638e8e013f7ccd5e.tar.gz
notes-dc3c197e2c96184f87d3bfe2638e8e013f7ccd5e.zip
linux: add cups
Diffstat (limited to 'src')
-rw-r--r--src/SUMMARY.md1
-rw-r--r--src/linux/README.md1
-rw-r--r--src/linux/cups.md71
3 files changed, 73 insertions, 0 deletions
diff --git a/src/SUMMARY.md b/src/SUMMARY.md
index 6d401d3..d5dcc82 100644
--- a/src/SUMMARY.md
+++ b/src/SUMMARY.md
@@ -82,6 +82,7 @@
- [acl](./linux/acl.md)
- [zfs](./linux/zfs.md)
- [cpufreq](./linux/cpufreq.md)
+ - [cups](./linux/cups.md)
- [Network](./network/README.md)
- [ssh](./network/ssh.md)
diff --git a/src/linux/README.md b/src/linux/README.md
index 196ae68..2c64e89 100644
--- a/src/linux/README.md
+++ b/src/linux/README.md
@@ -9,3 +9,4 @@
- [acl](./acl.md)
- [zfs](./zfs.md)
- [cpufreq](./cpufreq.md)
+- [cups](./cups.md)
diff --git a/src/linux/cups.md b/src/linux/cups.md
new file mode 100644
index 0000000..9fb2458
--- /dev/null
+++ b/src/linux/cups.md
@@ -0,0 +1,71 @@
+# cups(1)
+
+## Discover
+```sh
+# List available printer driver.
+lpinfo -m
+
+# List available printer devices (connected + network).
+lpinfo -v
+```
+## Install printer
+```sh
+# Add device with PRINTER name, practically all modern network printer use the
+# everywhere driver.
+lpadmin -p PRINTER -m everywhere -v DEVICE_URI
+
+# Delete named printer.
+lpadmin -x PRINTER
+```
+
+## Printer & Printing options
+```sh
+# List printer options.
+# CHECK printer-make-and-model
+lpoptions -p Brother_MFC_L2750DW_series
+# List printing options.
+lpoptions -p Brother_MFC_L2750DW_series -l
+
+# Set the default printer (stored in ~/.cups/lpoptions).
+lpoptions -d Brother_MFC_L2750DW_series
+```
+
+## Inspect installed printer.
+```sh
+# List default printer.
+lpstat -d
+# List installed printer (-l for longer output).
+lpstat -p
+# List printer accepting state.
+lpstat -a
+# List printer and the attached device (eg device uri).
+lpstat -v
+
+# List all states at once.
+lpstat -t
+```
+## Print jobs
+```sh
+# Create print job.
+lp -d PRINTER FILE
+ -n NUM number of copies
+ -P PAGE_LIST pages to print (eg 1,3-5,10)
+ -o media=a4 paper format
+ -o number-up={2|4|6|9|16} input pages per output page
+ -o sides=one-sided print front-page only
+ -o sides=two-sided-long-edge print duplex
+
+# Remove pending print job.
+lprm JOOBID
+```
+
+## Control printer
+```sh
+# Enable/disable printer.
+cupsenable PRINTER
+cupsdisable PRINTER
+
+# Accept/rejects jobs for printer.
+cupsaccept PRINTER
+cupsreject PRINTER
+```