If you’re like me, you’ll often be messing around in Terminal and find you can’t remember (or don’t know) the correct syntax and options for a command you’re trying to issue.

You could look it up online and search through all the slightly different answers for different Unix-based systems, or you could use macOS’ built inmanual pagesto get your answer. This guide will show you how.

Article image

All Unix-based operating systems make use ofmanto some extent to outline the usage of their commands, which tends to vary between the different flavours, and macOS is no exception.

Whilst it is often possible (as demonstrated above with thecp rmandmvcommands) to view a simplified usage for a command by invoking it with no options attached, this does not always work. Sometimes no information is output, or the command is issued immediately in an unspecified way, which is not advisable.

Article image

How to use man pages to research Terminal commands

1)Open aTerminalwindow. If you’re already in the middle of something in Terminal when you need to look something up, that is also fine. The man pages can be invoked and exited without interfering with your current running Terminal commands.

2)At the command prompt, typeman, followed by aspace, followed by the name of the command you wish to research. For example, to see how to usediskutil, I simply type:

Article image

man diskutil

And hitEnter.

3)To page forward through the document, use theSpacebar, and to scroll through, use theUpandDownarrow keys. If you want to page back, you can use theBkey. To jump to a specific keyword, type/followed by the keyword you want to search for.

4)Upon reaching the end of the document, you will see the following:

Article image

When you see the(END)marker, you can quit the reader which you opened when you invokedman. You will not be able to issue any further Terminal commands in the window without exiting the man page reader, which is calledless.

5)To quit the man page view at any point, simply press theQkey, and it will kick you back out to your standard Terminal command prompt:

Article image

It’s as simple as that! Now you won’t have to spend hours searching the exact syntax of that command you use once a year, or entering the Linux version of a command from the net into your Mac, wondering why it doesn’t work. The full documentation will always be at your fingertips.

Do you have any tips for us here at iDB? Are there any guides you would like us to write?Let me know at joe@idownloadblog.com.