How do I print a test page from the command line?

Asked by Vikram Hegde

Everything is running smoothly with HPLIP, but I want to print a test page from the command line. I am trying to schedule my printer to print once a week using crontab, but I need to tell it what command to run. The hp-testpage command seemed like the right one but it launches a GUI and you have to manually click a button to print. I want it to print automatically at a certain time without my intervention. Please let me know how to do this. Thank you.

EDIT: The reason I need to print once a week is to prevent my ink cartridges from drying up.

Question information

Language:
English Edit question
Status:
Solved
For:
HPLIP Edit question
Assignee:
No assignee Edit question
Solved by:
Ajay Kedar
Solved:
Last query:
Last reply:
Revision history for this message
Best Ajay Kedar (ajay-kedar) said :
#1

Hi Vikram,

Please try this command on terminal hp-testpage -i -p<Printer Name>.
Hope this will solve the problem

Regards,
Ajay

Revision history for this message
Vikram Hegde (vikramh50) said :
#2

It works, thank you. I was able to get it working without -p, I guess because I only have one printer, or perhaps because it may be set to default.