I am not able to cd into the samba like I would normally do:

cd smb://server/folder

It says: "bash: cd: smb/..." No such file or directory.

But if in nautilus I go to the folder and right click it, the location shown in the properties is:


Why isn't this working? Thanks


The program "cd" can only navigate into directories mounted to your local VFS, and a URI that starts with "smb://" describes a remote resource. In order to cd into an SMB share, you have to mount it.

In your case, it sounds like the SMB share was already mounted and accessible from nautilus. That means the SMB share is already mounted somewhere in your local VFS.

In Ubuntu 15.04, I believe the default mount point for SMB shares (at least the ones you connect to using nautilus) is:


So instead, try:

$ cd  /run/user/$UID/gvfs/smb:host=server/path/to/file.txt

Edit: For a more in-depth explanation of this, here is a similar question on unix stackexchange with some great answers


You cannot use just cd smb://server/folder from a terminal.

To access the folder from terminal you need to mount the folder first.

sudo mkdir /mnt/server

sudo mount -t cifs //remote/folder /mnt/server -o username=user uid=name

Or just type smbclient //hostname/folder and type the username/password. After successful login you will able to access the folders.

  • how do I set up to automount it with fstab? Currently looks like: smb://folder /media/folder nfts defaults 0 0; It says Failed to access volume, no such file or folder. But I got the "smb://folder" path from the automatically mounted in the network list. – Totty.js Oct 9 '12 at 13:09
  • I would recommend you to use autofs instead of fstab. Please refer this link to automount. – devav2 Oct 9 '12 at 13:15
  • mount.cifs doesn't use URLs, but UNCs - you would use //remote/folder rather than smb://remote/folder – jelmer Oct 11 '12 at 20:59
  • Yes I have mentioned that smb:://remote/folder wont work – devav2 Oct 12 '12 at 6:16

The shell (bash) does not use unique resource locators (URLs).

In addition to other answers that tell you how to mount samba shares manually, if you can access it with the file manager, it has already been mounted using gvfs. You will be able to access it throught the .gvfs/ directory in your home directory:

cd ~/.gvfs/

If I'm correct, you should see a directory called folder on server/.


The smb protocol cannot be used like this from bash. If you want to use it, you have to mount the smb share with the mount command, or to add it to your /etc/fstab, for example (taken from my fstab):

//server/smb-share /my/path/where/to/mount/it cifs  guest,uid=1000,iocharset=utf8,codepage=unicode,unicode  0  0


If the others don't work (as is my case), you'll likely find this will:

cd /$XDG_RUNTIME_DIR/gvfs/smb-share\:server=yourserver,share=yourshare/

Replace yourserver and yourshare appropriately.

If you're using tab completion, beware of your shell incorrectly escaping out commas, dollar symbols and slashes. The colon, however, should be escaped.

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.