Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

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.

share|improve this question
up vote 5 down vote accepted

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.

share|improve this answer
Perfect for OSX... thanks so much. – kivetros Mar 22 '11 at 16:21

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.

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

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