8

How can one list the shared folders of a server from the OSX Terminal? For example, I know that on server1, there are several shared folders, but to mount them, I need to know the name of these folders before I can mount them

1
  • And are you looking for the shares on the current logged in OSX system, or on a remote OSX system? Nov 3, 2012 at 18:24

3 Answers 3

17

SMB

Mac OS X 10.7 and above have the smbutil(1) command, which lists SMB shares (i.e. Windows shares):

smbutil view //user@hostname

In OS X versions prior to Lion (10.7), the smbclient(1) command was shipped:

smbclient -L //user@hostname

For more options, check the respective manpages.

NFS

For NFS, showmount(8) lists all available mounts on a host:

showmount hostname

AFP

None I'm aware of at the moment. See this Stack Overflow question: How to list AFP shares from command-line (MacOS)?

1
  • to connect as quest: smbutil view -g //hostname
    – To Kra
    Dec 27, 2016 at 17:42
8

For those who, like me, land here looking for a way to "View Shared Folders from Terminal" as asked in the title, but on the local machine, not on a remote server:

Samba has testparm to list the shares defined on the local machine, but current MacOS versions don't use Samba anymore. The equivalent command on MacOS is now

sharing -l

The -l option lists existing shares on the local machine (both afp and smb).

0

For NFS shares.

showmount server1 OSX showmount Man page

For SMB and AFS no idea.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .