Joshua Schnell, May 7, 2008
As you can tell, we’ve decided to write a couple articles on using the command line in OS X. There is so much power available at your finger tips if you can get through the learning process of the unix based environment. For instance, you have the ability to restart any machine from the command line both locally or across any network (internet included). This is great if you find that screensharing or VNC connections are running a bit slow.
To Restart the Server locally
- Type ‘shutdown -r now’
To Restart the Server remotely with ssh.
- ssh -l root server shutdown -r now
The ‘-l ‘ simply tells the server what your login name is, so, in this case it is root. The ‘server ‘ part of the command will be your URL, or IP address of the server. The ‘-r ‘ means you want a reboot. Don’t forget this, because if you do, your machine will be shutdown instead of rebooted. Which means you’d have to leave your desk and turn the thing back on!!! The ‘now ‘ means you want it done this instant.You can also set the time you would like the server to reboot by adding the time to the end of the command in the format ‘hhmm ‘. H for hours, M for minutes.
- ssh -l root server shutdown -r now 1130
There ya go. You no longer have to use a VNC (remote desktop) application to reboot a server. Which in my case is a great thing, considering my vnc-server software tends to freeze up a lot.Follow @macgasm