List of all shared folders
Solution 1:
Use this command: smbclient -L localhost
. A sample of its output is as follow:
Enter username's password:
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 4.1.6-Ubuntu]
Sharename Type Comment
--------- ---- -------
print$ Disk Printer Drivers
IPC$ IPC IPC Service (host-name server (Samba, Ubuntu))
hp1320 Printer Hewlett-Packard hp LaserJet 1320 series
HP-LaserJet-1200 Printer HP LaserJet 1200
Public Disk
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 4.1.6-Ubuntu]
Server Comment
--------- -------
host-name server (Samba, Ubuntu)
Workgroup Master
--------- -------
WORKGROUP HOST-NAME
Solution 2:
gvfs-mount -l
GVFS is the virtual filesystem for the Gnome desktop that allows access to shared drives via SMB, FTP, WebDav, and SFTP. Accessed shares are mounted under ~/.gvfs/
, you can see them there as well.
The command above lists all attached external drives, and network shares, e.g.:
$ gvfs-mount -l
Drive(0): 1.5 TB Hard Disk
[snip]
Mount(0): public on fileserver -> smb://fileserver/public/
Type: GDaemonMount
Mount(1): SFTP for bert on server.example.com -> sftp://[email protected]/
Type: GDaemonMount
Mount(2): WebDAV as bert on server.example.com -> davs://[email protected]/dav
Type: GDaemonMount
If you add the option -i
you get even more information.
Solution 3:
For samba shares we have a set of utilities that come with the samba suite:
-
smbtree
smbtree is a smb browser program in text mode. It is similar to the "Network Neighborhood" found on Windows computers. It prints a tree with all the known domains, the servers in those domains and the shares on the servers. Manpage
-
smbstatus
smbstatus is a very simple program to list the current Samba connections. Manpage
By invoking the following a list of shares will be displayed:
smbstatus --shares
See also: Manpage of samba