Mac OS: Take command of your OS

Tucked away inside your Utilities folder, which lives inside the Applications folder on your Mac, is OS X's terminal window. If you grew up using DOS machines, you'll find it somewhat familiar - there's a black and white screen, some arcane text telling you that it's your machine, and a tiny blinking cursor.

That's where the similarity ends. The OS X terminal isn't DOS and, although some of the commands are similar, they generally won't work. Instead, the terminal is a window into the UNIX nuts and bolts that underpin OS X. The average OS X user shouldn't ever need to venture anywhere near the command line interface, but since you're not the average OS X user, it's probably time to have a rummage.

Finding your way around

First, there's no way around it: you're going to have to learn some basic UNIX commands. Fire up the terminal and you'll be greeted with 'Welcome to Darwin!' followed by the name of your computer (you entered this when you were setting up OS X) and then your short username followed by a $. This is your parent directory. Everything owned by you is splayed out underneath this directory in a series of branches. The easiest way to think about this is imagining your username as the trunk, and then each folder (or directory) as a major branch. All OS X users have the same initial branches, including desktop, music and documents.

You want to have a look at these branches using the terminal (and, yes, we all know you can do this much more easily through the Finder!). At the prompt, type in cd documents. You'll now see that your username has been replaced by the 'documents'. To have a look at what's inside that Documents folder just type ls, which stands for 'list' and will bring up a complete list of everything that's inside your documents folder.

From here, it's possible to modify and move anything within the folders that your username has rights to access. To return to the top of the tree, just type cd .. and you'll be back at your user directory.

When you're finished with jumping in and out of directories and generally moving around, it's time for something more interesting.

Disk repair

OS X has a pretty good disk repair utility that lives in the same directory as the terminal. This utility uses a command line tool called fsck-hfs to do its maintenance work on your hard drive. It also runs during automatic reboots, checking that the integrity of your hard drive hasn't been compromised.

To take a quick look at this command line utility, simply type fsck_hfs at the command line. This will provide a list of terms you can use to modify the way that the repair tool operates. This is where things start getting tricky, and we don't recommend that you spend too much time (at the moment) trying to run disk repair from the command line. It is, however, worth knowing that it's there, and understanding that behind OS X's pretty interface, tools like fsck-hfs are how things get done.


Crashing was a fact of life under OS 9. Simply having a Classic machine that actually ran all day was a feat. OS X is the model of stability, and some people report that they've only shut down their machine when it's come time to update software. There isn't a pretty way to find out how long your machine's been up and running, but it's a snap from the command line. Simply enter the term uptime and you'll get a measure of how long your computer's been up. (The screen shot) shows that mine was up for only three hours, due to a software update session), as well as the number of users and a snapshot of how hard your computer's been working as a percentage of CPU load.

If that's not enough information for you, and you want to look super geeky in front of your Mac-mates, try using the top -u command, which continually updates the number of processes your machine is running. These could be user programs like iTunes, or machine processes like the Finder or the Aqua user interface. It will also show the percentage of the CPU that these processes are using, the amount of memory being accessed, and the amount of virtual memory being used.

Getting access to all this information, which is also available through an appli-cation called Process Viewer in the Utilities folder, is as easy as entering top -u at the command line. For the complete geek-in-charge look, drag the terminal window over to one side of your screen and let it update while you work.

Join the newsletter!


Sign up to gain exclusive access to email subscriptions, event invitations, competitions, giveaways, and much more.

Membership is free, and your security and privacy remain protected. View our privacy policy before signing up.

Error: Please check your email address.
Keep up with the latest tech news, reviews and previews by subscribing to the Good Gear Guide newsletter.

Joshua Gliddon

PC World
Show Comments

Brand Post

Most Popular Reviews

Latest Articles


PCW Evaluation Team

Luke Hill


I need power and lots of it. As a Front End Web developer anything less just won’t cut it which is why the MSI GT75 is an outstanding laptop for me. It’s a sleek and futuristic looking, high quality, beast that has a touch of sci-fi flare about it.

Emily Tyson

MSI GE63 Raider

If you’re looking to invest in your next work horse laptop for work or home use, you can’t go wrong with the MSI GE63.

Laura Johnston

MSI GS65 Stealth Thin

If you can afford the price tag, it is well worth the money. It out performs any other laptop I have tried for gaming, and the transportable design and incredible display also make it ideal for work.

Andrew Teoh

Brother MFC-L9570CDW Multifunction Printer

Touch screen visibility and operation was great and easy to navigate. Each menu and sub-menu was in an understandable order and category

Louise Coady

Brother MFC-L9570CDW Multifunction Printer

The printer was convenient, produced clear and vibrant images and was very easy to use

Edwina Hargreaves

WD My Cloud Home

I would recommend this device for families and small businesses who want one safe place to store all their important digital content and a way to easily share it with friends, family, business partners, or customers.

Featured Content

Product Launch Showcase

Latest Jobs

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?