Network printer in command line

Issues related to configuring your network
Post Reply
m.yazdian
Posts: 3
Joined: 2015/05/19 05:04:58

Network printer in command line

Post by m.yazdian » 2015/05/19 05:12:33

Hello everyone,
I like to print my document from my linux server in to the network printer
I install cups on my linux and add the network printer on it by
lpadmin -p test -E -v socket://192.168.1.2/'HP LaserJet 1018'

So when I check the lpstat -v I get this message:
device for classtest: ///dev/null
device for test: socket://192.168.1.2/HP LaserJet 1018

lpstats -r
scheduler is running

but when I send the file in the job to print it's not work
lpr -P test /var/www/html/print.txt

lpstat
test-23 root 1024 Tue 19 May 2015 04:26:55 AM EDT

my network printer on the windows client and shared on the workgroup network and I can ping the windows computer from the linux by ping 192.168.1.2

please advise me to solve the problem
Many Thanks.

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: Network printer in command line

Post by gerald_clark » 2015/05/19 15:53:45

Your windows printer is not a socket ( HP directjet ) printer.
If the printer is actually a HP directjet printer the device should be "socket://IPofPrinter".
Otherwise you need to use "smb://workgroup/server/name" or "smb://username:password@workgroup/server/name"

Please see the CUPS documentation.

m.yazdian
Posts: 3
Joined: 2015/05/19 05:04:58

Re: Network printer in command line

Post by m.yazdian » 2015/05/19 16:23:03

thanks for replay gerald_clark,
Should I do config any special samba service?
I install samba manually and set as a workgroup that's all.
In the windows client I hasn't password for gust users on the workgroup.

Post Reply