More Terminal Commands to Improve Your Mac Experience

You don’t have to be in a sci-fi movie to get in the background of your personal computer and “hack” through the system. For Mac users, Terminal is the part of your Mac that makes you feel this way. By simply adding to your “command line” you are able to manipulate aspects of your Mac to make for an easier or more customized use. We know that it can be “scary” to go into the Terminal and make use of the command line interface, today, we will show you that it really isn’t that difficult.

What is Terminal and Where is It?

The Terminal is an app found in the Utilities section of the Mac. This application is where you are able to enter command and make changes to your system without having to install third-party apps. Through lines of commands, you are able to change everything from how iCal processes events to changes with the login window. It may be ugly, but it is definitely the fastest way to get things done.


Terminal Basics

There are a couple of things to go over before we look into using some useful commands. First off, when you open terminal, you are presented with a line of code that is pictured above, showing your login and computer name. At the end of the line is a blinking cursor. This is where you will enter the command line.


Some basic commands:

cd: stands for “change directory”. When you open the terminal, the default directory is always your Users home directory. If you want to change the directory to other directory, say “Downloads”, you just use the command:

cd Downloads

ls: listing of the files and directories in the current directory. Simply type in ls in the terminal and it will display all the files and folders in the current directory.

cp: Copy a file/directory from the source to the destination. For examples, if I want to copy the file “video.mp4” from the current directory to the “Video” folder, I just need to use the command:

cp video.mp4 ~/Video/

mkdir: Also stands for “MaKe DIRectory”, this command allows you to create new folder.

mv: is short for “move”, which means to move a file from one place to another. It works exactly the same as “cp” except that the source file is removed after copying.

rm: This command allows you to remove (also known as “delete”) files/folders. For example:

rm video.mp4

In terms of command rules, there are a couple to remember. First off, Terminal is a text-only environment. This means that you don’t have to use a mouse at all. What if you are going to use one of the commands mentioned below and are wondering what secrets lie behind the specific command? This is done by typing man before the name of the command. Press Enter and the man(ual) of the specific command appears.

Some useful Terminal commands for Mac

Safari: Open links as second tab:

defaults write TargetedClicksCreateTabs -bool TRUE.

Put Safari into debugging mode:

defaults write IncludeDebugMenu 1

Change the Dock from 3D to 2D:

2d Dock

defaults write no-glass -boolean YES
killall Dock

Move the Dock to Left Side

defaults write pinning -string start

Not liking this? You can change the start in the above command to middle to restore it to the middle.

Always in plain text in Mail:

defaults write PreferPlainText -bool TRUE

Enable Half-star iTunes Ratings:

iTunes half star rating

defaults write allow-half-stars -bool TRUE

Shut down remotely:

sudo shutdown -h now

More Screenshot Options:

screencapture -x -t jpg capture.jpg
killall SystemUIServer

Change .jpg with whatever format you want screenshots saved as.

Eject an un-ejectable CD:

disktool -e disk

New Screenshot Destination:

defaults write location "/Users/yourusername/screenshots

Enable Desktop Widgets:

defaults write devmode YES

Change the YES to NO to disable it.

Can’t get enough? Here are more useful commands for you.

What other useful commands have we missed out?

Ari Simon
Ari Simon

Ari Simon has been a writer with Make Tech Easier since August 2011. Ari loves anything related to technology and social media. When Ari isn't working, he enjoys traveling and trying out the latest tech gadget.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox