Samba / SMB Syntax

By Ross Madden
Published on May 4, 2011 1:05 pm MT
Updated on July 19, 2021 9:41 am 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://ubiqx.org/cifs/Appendix-D.html

Back to top of page