Ubuntu – How to navigate to a samba location I’ve mounted in Nautilus on the command line

command linesamba

Please note: I am two weeks old in Linux. I have found a lot of answers to this question on the internet, tried many, but all failed one way or another. Therefore I dare to ask once again in the hope that someone here could explain it simply 🙂

Pre-conditions:

In my institute, we have a Samba server. In Windows, it is accessed by going to \\xyz.220.131.233\ and entering the login abc and the password def.

In Ubuntu, I was able to do exactly the same using Nautilus, pressing Ctrl+L and entering smb://xyz.220.131.233/. It then asks for the login and the password and connects. I can even drag a folder from here to the 'Places' and have a shortcut to the remote location.

So far so good. I've just installed Matlab and want to open this remote location. Trying to cd to smb://xyz.220.131.233/ returns

Cannot CD to smb://xyz.220.131.233 (Name is nonexistent or not a directory).

A Mac user in my group told me I first mount the location, but he didn't know how to do it.

Is it true and how do I do it?

Best Answer

In most cases:

$XDG_RUNTIME_DIR/gvfs

14.04:

/run/user/$(id -u)/gvfs

12.10:

/run/user/<username>/gvfs

12.04:

Since 12.04 the folder of mounted samba share is:

~/.cache/gvfs

11.10 and older

You can learn how to mount - it will sure works. But I think this is an easier solution for you: Nautilus mount smb partitions at ~/.gvfs (where ~/ means /home/user_name/ - example: /home/desgua/.gvfs).
You just have to navigate to there:

cd ~/.gvfs