Chris Hannah

Cool Things to do in Terminal

I’ve been playing around with Terminal recently (the command line interface for Mac), and I’ve come across a few cool things you can do with it. So here they are.

1. Watch Star Wars Episode IV

Star Wars
Yes, you can watch the first Star Wars movie straight from Terminal. The whole thing is in ASCII code, and it looks pretty good. I probably shouldn’t admit this, but I put this on in one of my rather boring university lectures. All you have to do is type:


You can do this in Windows as well, but sometimes you have to enable Telnet on your machine first, so here is a guide for that.

2. Play Retro Games

You can play some very cool retro games right inside your Terminal window, and it’s pretty easy too. Just type in emacs, press Enter, then press “Esc + X”, and then you can type in the games you want to play. Here are a few of the games:

  • tetris
  • pong
  • snake
  • solitaire
  • gomoku
  • 5×5
  • dunnet
  • landmark
  • doctor

3. Talk to a Doctor

You can also use Terminal to talk to a virtual psychologist! Use the same steps as above, but instead of typing a game, type “doctor” (without the quotation marks).

4. Set a Start-up Message

Add some personalisation to your Mac by adding a start-up message. Type the following, replacing Message with the desired text.

sudo defaults write /Library/Preferences/ LoginwindowText "Message"

You’ll be prompted for your password. I have mine saying Hello to me every time I turn my Mac on. To turn this off just type:

sudo defaults write /Library/Preferences/ LoginwindowText ""

5. Add some space to your Dock

If your finding your Dock a bit too cluttered, you can add some extra separators to space out the icons a bit more. Copy this into Terminal to add a new separator:

defaults write persistent-apps -array-add '{"tile-type"="spacer-tile";}'; killall Dock

To remove it, just drag it out of the Dock.

6. Make it Speak

This is a pretty easy one, and although probably isn’t very useful, it’s quite fun! Just type say followed by the text you want it to say, and then press Enter.

7. Prevent your Mac from Sleeping

There are some apps around for Mac that stop it going to sleep, like Coca and Caffeine. But if you want to do it in Terminal instead, then there’s just one small bit of code you’ll need to know: caffeinate -u -t 3600 To change the amount of time to prevent sleep, just change the value where it is 3600. It is measured in seconds, so the code above will keep your mac awake for an hour.