If you want to export a man (manual) page for a command into a file, then you can make use of the Mac Terminal and make use of the output redirection symbol along with the file name that you want to export the text of the man page.
Let's take a look at an easy example:
man whoami > whoami_man_page.txt
Let me cat this file to see its content.
% cat whoami_man_page.txt
WHOAMI(1) General Commands Manual WHOAMI(1)
NAME
whoami – display effective user id
SYNOPSIS
whoami
DESCRIPTION
The whoami utility has been obsoleted by the id(1) utility, and is
equivalent to “id -un”. The command “id -p” is suggested for normal
interactive use.
The whoami utility displays your effective user ID as a name.
EXIT STATUS
The whoami utility exits 0 on success, and >0 if an error occurs.
SEE ALSO
id(1)
macOS 13.4 June 6, 1993 macOS 13.4
If you want to append data to the same file for other man pages, instead of > make use of >>
| Operator | Description | Example |
|---|---|---|
> | Used to redirects the output of a command to a file. | man ls > man_ls.txt |
>> | Used to appends the output of a command to the end of a file. | man ls >> man_pages.txt |

Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!