O'Reilly logo

Beginning Mac OS® X Programming by Drew McCormack, Michael Trent

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

A.1. Chapter 1

A.1.1. Exercise 1 solution

The first two apropos commands return far too much information to be useful. The third command, apropos "copy file" returns a reasonable amount of information:

Macintosh:~ sample$ apropos "copy file"
CpMac(1)                 - copy files preserving metadata and forks
File::Copy(3pm)          - Copy files or filehandles
cp(1)                    - copy files
cpio(1)                  - copy file archives in and out
ditto(8)                 - copy files and directories to a destination directory

From that result, you might surmise that CpMac, cp, or ditto would be an appropriate tool for copying files. Of course, the manual entry for each command provides more helpful information.

A.1.2. Exercise 2 solution

The command man -k "copy file" is equivalent to apropos "copy file" and yields the same results as Exercise 1.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required