Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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

Is there possible to list all shared folders (with their physical locations) from command line?

share|improve this question
Sharing using the same OS? Are using Samba? – Mitch Oct 10 '12 at 9:53
both, if possible – ts01 Oct 10 '12 at 10:17

For samba shares we have a set of utilities that come with the samba Install 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

share|improve this answer
Non of smbtree and smbstatus commands list my shared folders! – PHP Learner Aug 2 '15 at 12:18
@PHPLearner: try with sudo smbstatus --shares – Takkat Aug 2 '15 at 14:47
This is the result for sudo smbstatus --shares: Service pid machine Connected at (nothing in the list). – PHP Learner Aug 2 '15 at 17:01
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
Mount(0): public on fileserver -> smb://fileserver/public/
  Type: GDaemonMount
Mount(1): SFTP for bert on -> s
  Type: GDaemonMount
Mount(2): WebDAV as bert on -> davs://
  Type: GDaemonMount

If you add the option -i you get even more information.

share|improve this answer

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
---------            -------
share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.