How to clear the CUPS print queue

To cancel a print job in the queue just use cancel. To see all the available jobs in the queue just use lpstat.

$ lpstat -o
HP-Officejet-7610-2-128 user2     240640   miƩ 09 mar 2016 11:07:14 CET
HP-Officejet-Pro-8620-137 jose             55296   dom 03 jul 2016 13:29:49 CEST
$ cancel -a HP-Officejet-7610-2-128
$ cancel -a HP-Officejet-Pro-8620-137
Advertisements

xterm-256color: Unknown terminal type

Problem

If you connect to a Solaris by ssh from Linux or MacOSX you can get the following message when using vi:

# vi httpd.conf
xterm-256color: Unknown terminal type
I don't know what kind of terminal you are on - all I have is 'xterm-256color'.
[Using open mode]
"httpd.conf" 705 lines, 24071 characters
#
# This is the main Apache HTTP server configuration file. It contains the

Solution

Define the TERM environment variable:

# export TERM=xterm

Now you can execute vi:

# vi httpd.conf

This change is valid just for the current Terminal session. If you want to make it permanent you have to add that export to your ~/.bashrc file. If you want to make the change permanent for all the users you can edit the /etc/profile file or add a new file in /etc/profile.d/