Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I know few commands regarding Mac OS X's Terminal like ls, cd, mkdir etc.

What I want to do is switch over a network computer - how ?

What I tried is as follows -

  • cd /
  • ls
  • cd Network
  • ls ( here I found no computers )

What exactly I am missing ?

Thanks in advance for sharing your knowledge.

Sagar

share|improve this question
1  
What do you want to accomplish? “Jump”ing on a computer is a bit non-specific. Do you want to access another computer’s shared files? Do you want to run commands on another computer? Something else? –  Chris Johnsen Jul 2 '10 at 11:30
    
Yep ! Same - @Chris - I want to jump to specific / another computer's shared files. As we can explore them using through finder - I want to do the same with terminal. –  Sagar R. Kothari Jul 2 '10 at 11:36

3 Answers 3

up vote 5 down vote accepted

You can use smbtree to list all shares. You can then use mount to mount the share and cd to navigate into it. Note that you need to create the folder you want to mount the share onto. (Alternatively you can mount the share using finder and just navigate to it via cd. They are mounted in /Volumes).

Here's an example of mounting a share, listing its contents and unmounting it again.

cd /Volumes
mkdir myshare
mount -t smbfs //guest@myhost/myshare myshare
ls myshare
umount myshare
rm -r myshare
share|improve this answer

I would use SSH to log into the remote computer, then if you want to transfer any files use scp (SSH copy). A quick search on "SSH on OSX" should get you what you want, in general here are the steps:

1. open terminal on OSX
2. type "ssh [username]@[ip address of remote computer]"

now it's as if you opened terminal on that computer.

You will need to enable SSH in the remote computer's system preferences.

Here's one tutorial (there are many others): http://www.macosxhints.com/article.php?story=20010401050833391

share|improve this answer
    
You can also use Terminal's Shell > New Remote Connection to browse network computers and create an ssh session. –  Chris Page Aug 21 '11 at 10:48

You can always use drag'n'drop: open terminal window, type cd (note space at end) connect to network share and drag it to terminal window, press enter…

Also, if you have bash 4.x, you can add shopt -s autocd to your ~/.bash_login or ~/.profile to skip typing cd part, just directory name.

share|improve this answer
1  
As of Mac OS X Lion 10.7, if you drag a directory (a folder or a server) onto a terminal tab in the tab bar, Terminal will automatically issue a cd command. Also, if you drag onto the tab bar, it will create a new tab at that directory. Dragging onto the Terminal application icon will create a new terminal window at that location. –  Chris Page Aug 21 '11 at 10:49

Your Answer

 
discard

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.