Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

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

Here is a simple scenario I have:

  1. Windows 7 is sharing a folder (D:\Projects).
  2. Full Control permissions have been given to the folder.
  3. In Ubuntu 10.10, I can see the Windows shares from Places -> Network menu.
  4. I can create a folder in the shared Projects folder from Nautilus

How do I ls those same folders (displayed in Nautilus) from the terminal? (mount and ls /mnt do not list those Windows shares)

Ps. Details on what I am doing:

  1. Using Ubuntu as a "headless" VM using VirtualBox.
  2. Accessing Ubuntu via PuTTY
  3. Ability to give complete access to the Ubuntu VM for the Windows shared folder
share|improve this question
up vote 5 down vote accepted

If you've already used Nautilus to connect to the shares you're interested in, then the mounts for those shares are available in ~/.gvfs

So I've gone to my nautilus and typed smb:// into my location bar, which has mounted the share. Then :

scaine@GroovyTosh:~/.gvfs$ ls -al
total 20
dr-x------  3 scaine scaine     0 2010-12-31 18:47 .
drwx------ 68 scaine scaine 20480 2010-12-31 19:42 ..
drwx------  1 scaine scaine     0 2010-10-05 19:57 data on

If you need to list available shares, then as Danny says, you use smbclient. In my case, I use "share" security model (not recommended!), so I don't need the -U parameter :

scaine@GroovyTosh:~/.gvfs$ smbclient -L
Enter scaine's password: 
Domain=[Mine] OS=[Unix] Server=[Samba 3.5.4]

    Sharename       Type      Comment
    ---------       ----      -------
    Data            Disk      Core Data
    Backups         Disk      Daily RSnapshot backups
    IPC$            IPC       IPC Service (Core)
Domain=[Mine] OS=[Unix] Server=[Samba 3.5.4]

    Server               Comment
    ---------            -------
    CORE                 Core

    Workgroup            Master
    ---------            -------
    Mine                 CORE
share|improve this answer

smbclient may be able to list the shares available on a windows machine, but not the machines.

smbclient -L <windows-box> -U <username>
share|improve this answer
smbclient -U windowsUserName%password -L windowsHost -W domainName
share|improve this answer

Windows shares can also be accessed in the below way:

smbclient -L < Windows host name > -U < Windows Administrator account >
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.