Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Linux host with Samba installed and a Windows server with some Files. Samba is set up correctly and works just fine. I can show PDFs from the Windows server with

evince "smb://SRV/Share/.../xx.pdf"

but when I want to print this file with

lp –d lpX "smb://SRV/Share/.../xx.pdf" 

an error occurs:

lp: Error – Access ?smb://SRV/Share/.../xx.pdf? not possible - File or Directory not found

Why do I get this error?

share|improve this question

migrated from stackoverflow.com Apr 4 '13 at 22:28

This question came from our site for professional and enthusiast programmers.

up vote 2 down vote accepted

lp is a core Linux utility and doesn't understand non-file based names such as smb://.

evince is a gnome application which understands urls.

You should be able to use:

smbget -O "smb://SRV/Share/.../xx.pdf" | lp -d lpX -

to print from a samba url.

smbget accepts the -u username and -p for the password (otherwise it prompts for them). You can use -a for anonymous access, which causes it to try without a username/password

share|improve this answer
Thanks a lot! I searched a lot on the Internet, but never would I have found this. Works like a charm! – Georg Apr 4 '13 at 13:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.