Mac OSX Operating System

OSX Terminal Tricks

There are some really helpful shortcuts you can use in terminal that can make your day a lot easier. And of course, there are some fun commands you can use as well. Here’s a taste of some of the conveniences and entertainment terminal can provide.

While typing in terminal, if there’s a particularly long command line that you’re typing you can open up a text editor and work in there by pressing the following while in terminal:


This allows you to edit and add to the line in a text editor. To exit the text editor, you just save and close the file. If you don’t want to put the line in any longer, leave the editor blank to save and close. Whatever was in the editor will end up in terminal!


This command invokes text to speech, so if you type say “Hello World” the words Hello World will be said out loud by your computer.

XKCD comic


Yep, this is a command. If you type this in, the last command you used will be rerun. Particularly useful if you use a command and then find that you need to run it as a superuser, you can type “sudo !!”

Screen Shot 2013-05-24 at 8.57.24 AM

cd –

This will return you to your previous directory. Particularly useful if you accidentally move somewhere else!

Screen Shot 2013-05-24 at 8.58.34 AM

Instead of pressing the arrow keys to move around in your command line, you can click and hold in the location that you want to move the cursor to! There are a few other shortcuts as well:

ctrl+A: moves to the start of the line

ctrl+E: moves to the end of the line

ctrl+B: move back one character

ctrl+F: move forward one character

esc+B: move back one word

esc+F: move forward one word

ctrl+U: delete from the cursor to the beginning of the line

ctrl+K: delete from the cursor to the end of the line

emacs -batch -l dunnet

Just do it. Have some fun.


This allows you to give a name to a command, essentially. alias word=”command” allows you to simply type that word in the future, and the command will run.

Screen Shot 2013-05-24 at 8.55.59 AM

Now that you have the tools, go rock that terminal!