Samba / SMB Syntax

By Ross Madden
Published on May 4, 2011 1:05 pm MT
Updated on March 19, 2012 1:06 pm MT
Posted in Internet & Networking, Knowledge Base

Here’s a cheat sheet for Samba syntax – used to mount SMB/Linux/Windows shares on Windows, OSX, and Linux systems:

Basic form:
smb://[[[authdomain;]user@]host[:port][/share[/dirpath][/name]]][?context]

UNC FORM  URL FORM

\\host\share  smb://host/share

\\host\share\dirpath smb://host/share/dirpath

\\host\share\dirpath\filename  smb://host/share/dirpath/filename

 

Examples:

smb://host/share/

smb://host/share/dirpath

smb://host/share/name

smb://host/share/dirpath/name

smb://WORKGROUP@host/share

smb://WORKGROUP;User@host/share

 

Usually the name of the share must be specified.

Shared disks are specified with a trailing $, e.g. for C the share is C$

Substitute %20 for any spaces in the share names.

 

References:

http://tools.ietf.org/html/draft-crhertel-smb-url-00

http://ubiqx.org/cifs/Appendix-D.html

Back to top of page