Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Is there an interactive online terminal?

Hello All,


I don't own a a Mac myself, but I work for an ISP. We are in the process of writing documentation so that our end users will have a more better way of understanding how to get the information we ask for.


I was wondering if someone knew a website that had an interactive Mac Terminal(operates as if it is a real Mac Terminal). So I can test some commands to see how to get the information I need.

Posted on Mar 19, 2015 2:09 PM

Reply
12 replies

Mar 19, 2015 3:02 PM in response to kenulrich

Mac OS X is a Multiple-User system, and some of what you may be asking about may not be possible.


The terminology you are using is ambiguous.


The Mac has a program called Terminal which provides a unix command-line interface. To get access to that remotely, you log in (provided you are a User with an account on that Mac) using the ssh unix command. This creates a new unix shell environment for you, running on the remote Mac, completely separate from the experience the Main Mac User is having at the exact same time. This may be useful for certain things, but considering your are not in the same User Space as the main Mac User, and almost everything is stored on a per-user basis, I cannot fathom how this could be helpful for tech support.


If you meant to use the and possibly control the Main Mac OS X User's screen, for tech support, this also requires authorization and authentication, but can be accomplished (over a VPN connection) using the built in features of Screen Sharing.


If you meant the ability to make a TTY-like connection with a Mac, you DO need to get out more often.

Mar 19, 2015 3:07 PM in response to Grant Bennet-Alder

Yes, I am familiar that Mac Terminal's are the equivalent to Windows Command Prompt. Most typical end user's that just use devices for day-to-day browsing wouldn't know how to enable ssh..


Let me re-phrase the question like this: Can the majority of the commands in Linux (ifconfig, netstat, etc) the same in the Mac Terminal? If so, I use Linux all the time, so I could just use Linux as the source IF the Mac has the same BASH kernel so to speak.


I know in Linux(depending on the flavor/distribution) you can use "route -n" or "netstat -nr | grep default" to get the default gateway. But I'm not sure if the Mac Terminal has the same concept.


As far as your comment on the Remote Program, Yes, we can use that. But we prefer to use as a last result type method due to the connection time of said program.


I can't afford a Mac, and if anything, I would prefer to just purchase the OS itself to install in a Virtual Environment(I.e VMWare, Virtualbox, etc).

Mar 19, 2015 3:23 PM in response to kenulrich

The Mac Terminal command provides a fully-quailified posix environment when the logged in User invokes it. Iy runs the BASH shell by default, but can load any other shell available. It is not watered down in the slightest.


Like all unix and linux tools, it is like an extremely sharp instrument. There are no checks and balances on it, and a novice User is just a likely to cut their hand off as accomplish anything useful.


The beauty of the Mac OS X interface is that it is friendly and helpful for the novice User. It is THE most approachable, easy to use and experiment with. If you later decide to fill your mind with its shortcuts, the interface does not get in your way for high-speed work.


Mac OS X runs on Macintosh Computers. Using it on a non-Macintosh computer requires numerous hacks, and is specifically precluded -- a violation of the license agreement. You really ought to get your company to buy you an inexpensive Mac to train on.

Mar 19, 2015 5:01 PM in response to Grant Bennet-Alder

There are LOTS of diagnostic built into Mac OS X, and although Terminal commands can produce results that are familiar, they may not produce results that are helpful.


There is a huge searchable library of support articles that can walk you through a myriad of problems. Here is an example of an article on connection problems:


Wi-Fi: How to troubleshoot Wi-Fi connectivity - Apple Support


One of the simplest yet most powerful is to hold down the Option key while you click on the Wi-Fi icon on the MenuBar. in 10.7 and later, it produces a display like this one, full of actionable information:

User uploaded file


If there are additional Networks in range, they are listed as well.


From the System Preferences > Wi-Fi pane, you can choose (Assist Me ) > ( diagnostics ) ...

... and get a real good idea where the connection problem lies.

Mar 20, 2015 12:19 PM in response to kenulrich

Visit an Apple store. In my experience they are vary friendly, they let you play around with the Mac. Get in terminal and try out your commands. Take a flash drive to copy output.


Try to see if there is a local mac users group in your area: MUG

https://www.apple.com/usergroups/


If you do not have too many command post them here. Post what you tried out in linux.


Note, the Mac user are not familiar with the terminal. They will not know you need to press return after entering a command. Most linux user are familiar with the terminal since the terminal is used for diagnostics.


Robert

Mar 20, 2015 12:49 PM in response to kenulrich

The Mac OS X command line environment is mostly based on FreeBSD commands, not GNU/Linux. I too work on Linux systems all day long, and while many of the more common commands are similar, I have to use a lot of

if [[ $(uname) = *Darwin* ]]; then ... ; elif [[ $(uname) = *Linux* ]]; then ...; fi

type conditionals in my scripts.


While Mac OS X is POSIX, POSIX does not cover admin related commands, nor does it insist that POSIX commands support every option available to Linux flavors of those commands.


You should follow rccharles's advice and visit an Apple Store and play with Terminal. Take a long a list of commands you need to experiment with and take notes as you go.


You can also get 'man' pages on line. For example Google: "Mac OS X man netstat" and you will find the

<https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/ man1/netstat.1.html>

man page on-line. repeat for other commands you want to find out if it exists, and if it has the options you expect.


You can also ask around work if anyone owns a Mac. There must be at least one or 2. Ask if you can use a non-privileged Guest account to play with the Terminal.

Mar 20, 2015 2:28 PM in response to rccharles

There are only 2 commands, I'm interested in.



route -n

netstat -nr | grep default


In Linux(I'm not sure if your familiarity of it) When you do route -n it produces sort of the description below. I am not sure if Mac has the same output.


Destination Gateway Genmask Flags Metric Ref Use Iface

0.0.0.0 192.168.1.1 255.255.255.0 U 0 0 0 eth0

192.168.1.254 0.0.0.0 255.255.255.0 U 0 0 0 vmware1

172.16.30.20 0.0.0.0 255.255.255.0 U 0 0 0 vmware2

Mar 20, 2015 4:00 PM in response to kenulrich

netstat seems like it will do what you want

netstat -nr|grep default

default 172.16.1.1 UGSc 24 2 en1

And this is netstat when a Cisco AnyConnect VPN connection established:

netstat -nr|grep default

default utun0 UCS 7 0 utun0

default 172.16.1.1 UGScI 3 0 en1

default link#10 UGCS utun0

However, 'route' DOES NOT work the same as Linux

<https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/ man8/route.8.html>


I'm not sure what you want to get out of route. I am not really familiar with Mac OS X 'route', so I poked around and came up with

route -n get 172.16.1.1 # My router

route to: 172.16.1.1

destination: 172.16.1.1

interface: en1

flags: <UP,HOST,DONE,LLINFO,WASCLONED,IFSCOPE,IFREF,ROUTER>

recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire

0 0 0 0 0 0 1500 968

route -n get apple.com

route to: 17.178.96.59

destination: default

mask: default

gateway: 172.16.1.1

interface: en1

flags: <UP,GATEWAY,DONE,STATIC,PRCLONING>

recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire

0 0 0 0 0 0 1500 0

Maybe there is a different way to get what you want. If your intention is to 'add' routes, or to change the 'default' gateway, then that seems to be something 'route' does, but getting the Linux kind of "route -n" output is not what Mac OS X 'route' does. Maybe Google can be helpful in this case.

Mar 20, 2015 5:07 PM in response to kenulrich

the linux route -n is summarizing information of some sort.


Here is the mac os x terminal output of arp and ifconfig. ( Some information hidden ... )


root #  arp -a
? (192.168.0.1) at 0:19... on en0 [ethernet]
? (192.168.0.100) at 0:1f... on en0 [ethernet]
? (192.168.0.255) at (incomplete) on en0 [ethernet]
 root #  ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
    inet 127.0.0.1 netmask 0xff000000 
    inet6 ::1 prefixlen 128 
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    inet6 fe80::...1c%en0 prefixlen 64 scopeid 0x4 
    inet 192.168.0.10 netmask 0xffffff00 broadcast 192.168.0.255
    ether 00:... 
    media: autoselect (100baseTX <full-duplex>) status: active
    supported media: none autoselect 10baseT/UTP <half-duplex> 10baseT/UTP <full-duplex> 10baseT/UTP <full-duplex,hw-loopback> 100baseTX <half-duplex> 100baseTX <full-duplex> 100baseTX <full-duplex,hw-loopback>
fw0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 2030
    lladdr 00:03... 
    media: autoselect <full-duplex> status: inactive
    supported media: autoselect <full-duplex>
 root # 

Mar 22, 2015 6:19 PM in response to kenulrich

Thanks all for the help.


So it appears that netstat is the equivlant of route -n in linux. I knew that the Mac OS X is somewhat based on Linux Bash system but I wasn't sure to the exact extinct that it was(if that makes sense).


Thanks all for the help and detailed insight(I'll mark down the going to the store to test for future assistance as well).

Is there an interactive online terminal?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.