How to access a shared drive from the command prompt on OS X

Solution 1:

If a network share is already mounted in the Finder, it will be accessible through /Volumes in a shell, e.g. if your share is called "music", you'll find it under:

/Volumes/music

If you still need to mount it, you can actually mount it wherever you like — ideally not to /Volumes, but for example on your desktop. You can use mount_smbfs to do so. The complete syntax would be like this:

mount_smbfs //[domain;][user[:password]@]server[/share] ~/Desktop/music

In your case, if you have no special login and just guest credentials, maybe the following is enough – when prompted for a password, you can just press Enter and skip it:

mkdir -p ~/Desktop/music
mount_smbfs //host/music ~/Desktop/music

… and voilà:

enter image description here

If you have a user and password, you could use //user@host/music, and then enter the password interactively.

To safely unmount it, just call the following:

umount ~/Desktop/music/