3

So UI printing fails with no reason as always.

I hope that I can get more details by printing from command line.

Tried

smbutil print //user@host/share file

got:

smbutil: unknown command print

Do I have to install something?

(I have OS X 10.10)

Uko
  • 957
  • print is a windows command - look at lpr for Unix printing. Also what app are you printing with - was there anything ion the console. What promter were you printing to – mmmmmm Oct 13 '14 at 18:13
  • @Mark thank you for reply. I need to print to smb share, and I don't know what is the "promter". I set up the printer in CUPS, and now there it says: pending since "Unable to connect to server". And I have no idea if the problem is in reaching server or authenticating or whatever else. That's why I wanted to try to use command line which usually in verbose mode can give you a log of 2 A4 pages, where you can find something useful. (I was just printing from Preview with standard OS X stuff) – Uko Oct 13 '14 at 18:33
  • I found this for you to try: print [-connection_options] //user@server/share file – Ruskes Oct 13 '14 at 18:35
  • @Buscar웃, yes, but this is part of smbutil, right? That's what I was using and it says that the command is unknown – Uko Oct 13 '14 at 18:35
  • I assume you have the network share option installed/activated ? – Ruskes Oct 13 '14 at 18:39
  • See also http://apple.stackexchange.com/questions/125577/printing-to-a-windows-printer-from-the-command-line-smbclient-c-print?rq=1 - which implies print is not part of Apple's smbutils - Possibly get a version direct from samba? – mmmmmm Oct 13 '14 at 18:42
  • @Mark, print is not strictly a windows command; It's also present with the Linux version of smbutils, and it once was included in the OS X version. You are quite correct about lpr — this is the command one would use to print from terminal on OS X. – l'L'l Oct 13 '14 at 19:00

1 Answers1

1

What you are really looking for is a smbclient alternative using smbutil but just like you, I couldn't make it work. So what you can do is to install samba with homebrew like this:

brew install samba

If brew link complains with:

Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink lib/auth
/usr/local/lib is not writable.

you can link smbclient manually:

cd /usr/local/bin
sudo ln -sfv ../Cellar/samba/3.6.25/bin/smbclient smbclient
sudo chown -R your_user /usr/local/bin/smbclient

Now you should be able to print like this:

smbclient "\\\\your.server.com\\YourSharedPrinter" -U "Domain\User" -c "print YouFileToPrint"
Kyr
  • 126
  • Doesn't work at the time of this comment. The samba package has been removed from brew's core formulae. I tried installing it using brew install homebrew/boneyard/samba but that failed too, with the following error: Error: samba was moved to homebrew-boneyard because it has unfixable issues. Please do not file any issues about this. Sorry!. – Ohad Schneider Jan 25 '17 at 16:51