Support Wikipedia

Friday, March 27, 2015

Accessing samba bookmarks from linux command line

You can setup bookmarks to any folder on a host running samba with something like this

After providing the credentials. you can browse through the folder on file explorer(for example nautilus on ubuntu).

To access the same from command line, you don't need to mount any network drives, it's already mounted for you.


ls -l /var/run/user/1001/gvfs/

where 1001 happens to be the folder assigned for my user id.Yours could be different.

This should list all the samba shares that are active.

$ ls -l /var/run/user/1001/gvfs/
total 0

drwx------ 1 myuser myuser 0 Mar 19 11:07 smb-share:domain=mydomain,server=host,share=,user=myuser
drwx------ 1 myuser myuser 0 Feb 16 13:29 smb-share:domain=mydomain,server=host,share=,user=myuser

To access the different shares all you have to do is cd to it. That's it, job done.