At work, I spend a lot of time manipulating files on a networked computer that's running SME Server (but that's set up for Windows filesharing, if that somehow makes a difference).

I have been wondering how to cd to the network drive's root from bash so that I don't have to keep calling up Finder / nautilus every time I want to copy a file. Any suggestions?

In Ubuntu, I connect to the drive as a Windows share via Places - Connect to Server. In OSX, well, I logged in to the drive once, and it just shows up in Finder.


For OS X look for your share name under /Volumes (it may have a "-digit" at the end if you have many mounts with the same name). The same goes for mounted CD/DVDs and disk images.


While technically using Samba, Nautilus uses gvfs, which uses FUSE to mount the SMB share using libsmbclient, you aren't actually mounting the filesystem as you would with the mount command. When you use Nautilus with SMB mounts, a background process gvfsd-smb is started. You can access the mountpoint in ~/.gvfs/, where there's a directory in there with a name based on the mount settings you used to connect.

Check out /proc/mounts to see the details of the gvfs-fuse-daemon's mountpoint.

  • It appears that instead of using ~/.gvfs, samba (fuse) now uses /run/user/$USER/gvfs/. This is on a Fedora 17 box as of July 2012. – user20636 Jul 6 '12 at 14:46

An easy way is to mount the share using SAMBA. After installing samba you can mount the share as follow:

mount -t cifs -o username=user,password=secret //server.com/share /mount/point

There is a guide for openSUSE that appears via Google. See man mount.cifs for more options.

  • Note that if you've connected to the server via Places - Connect to server, you should be able to open a terminal in the folder from nautilus. Gnome uses samba behind the scenes, and mounts the share just as phunehehe suggests above – gnud Mar 22 '11 at 15:31
  • In ubuntu, this command requires sudo. I want it in a script. Is there a way to authenticate it once and then let it run with sudo every other time? – mouche Apr 1 '11 at 5:14
  • @mouche How about running with sudo script? See this answer to another question – phunehehe Apr 1 '11 at 5:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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