使用CUPS打印服务

本文介绍了CUPS(通用UNIX打印系统)的详细使用,包括配置文件、SPOOL假脱机、支持的打印机类型,以及如何安装、配置、管理和使用CUPS。重点讲解了CUPS的配置文件cupsd.conf、cups-files.conf、printcap和printers.conf,以及如何处理后端错误。此外,还涵盖了打印机驱动的安装、添加打印机的步骤,包括如何找到打印机URI、添加驱动、设置打印机选项。文章提供了丰富的命令行示例和参考资料,适用于Linux系统的CUPS打印服务管理。
摘要由CSDN通过智能技术生成

1. 测试环境

Printer: Xprinter XP-58IIH
指令支持: ESC/POS
接口: USB, 蓝牙
Linux系统: Arch Linux
$ sudo pacman -Qi cups
Name : cups
Version : 2.2.11-1
Description : The CUPS Printing System - daemon package
Architecture : x86_64
URL : https://www.cups.org/
Licenses : GPL
Groups : None
Provides : None
Depends On : acl pam libcups>=2.2.11 cups-filters bc dbus systemd
libpaper hicolor-icon-theme
Optional Deps : xdg-utils: xdg .desktop file support [installed]
colord: for ICC color profile support [installed]
Required By : None
Optional For : None
Conflicts With : None
Replaces : None
Installed Size : 13.92 MiB
Packager : Andreas Radke <andyrtr@archlinux.org>
Build Date : Sun 24 Mar 2019 06:39:26 PM CST
Install Date : Sun 07 Apr 2019 05:07:53 PM CST
Install Reason : Explicitly installed
Install Script : Yes
Validated By : Signature

2. CUPS介绍

https://www.ibm.com/developerworks/cn/linux/l-lpic1-108-4/index.html
管理打印机和打印 Ian Shields 2018 年 3 月 14 日发布
CUPS 原先为通用 UNIX 打印系统 (Common UNIX Printing System) 的首字母缩写,是 Linux 的打印机和打印作业管理器。
System 也有一个打印守护程序。它的功能类似于 Berkeley LPD,但采用不同的命令集。您将会经常看到两种具有不同选项但完成相同任务的命令。
例如,来自 Berkeley 实施的 lpr和来自 System V 实施的 lp 都可打印文件。
CUPS 打印系统的核心是作为守护进程运行的 cupsd 打印服务器。

2.1 CUPS的配置文件

2.1.1 cupsd.conf

CUPS 配置文件通常位于 /etc/cups/cupsd.conf 中。
原先 cupsd.conf 中允许的文件、目录和用户配置指令,现在改为存储在 cups-files.conf 中。这样可防止某些类型的特权升级攻击。

2.1.2 cups-files.conf

$ sudo cat /etc/cups/cups-files.conf
# Location of the file listing all of the local printers...
#Printcap /etc/printcap

2.1.3 printcap

自动生成的 /etc/printcap 文件。这是 LPD 打印服务器的配置文件名称,部分应用仍使用它来确定可用的打印机及其属性。
$ sudo cat /etc/printcap
# This file was automatically generated by cupsd(8) from the
# /etc/cups/printers.conf file. All changes to this file
# will be lost.
Xprint|Xprint:rm=tompc:rp=Xprint:

2.1.4 printers.conf

$ sudo cat /etc/cups/printers.conf
# Printer configuration file for CUPS v2.2.11
# Written by cupsd on 2019-04-09 14:41
# DO NOT EDIT THIS FILE WHEN CUPSD IS RUNNING
<Printer Xprint>
UUID urn:uuid:192cdccd-05bc-3ef7-4582-c6233773ef56
Info Xprint
Location pc
MakeModel Zijiang ZJ-58
DeviceURI usb://Unknown/Printer?serial=?
State Idle
StateTime 1554792072

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值