Many Unix commands admit comparatively elaborated manuals . You access these manuals using themancommand , as inman cporman ls . For simple Unix commands , readingmanpages in Terminal is fine . But for anything even slightly long — or especially for something gargantuan likeman bash — I encounter Preview to be a much skillful solution . you’re able to search for dustup , easy scan backwards and forwards , keep the whole thing as a PDF for future citation , change the soar storey of the document , and so much more . But how do you get a Unixmanpage into Preview ? Back in the April 2004 result of Macworld , we ran a tip in the Mac OS X Hints pillar that did just that . Given how useful this hint is , it ’s become a routine part of my work flow whenever I demand to catch amanpage .

In those pre - OS X 10.4 days , this expect export the contents of ( and then processing ) themanpage to a temporary file , then open that temporary file cabinet in Preview . With the release of Tiger , however , the cognitive operation became much dim-witted . So I think I ’d revisit that tip , as well as provide a very fundamental introduction to how a profile file works in thebashshell ( the default in 10.4 ) . ( If you ’re still using 10.3 , you ’ll demand to use the erstwhile solution , as detailed inthis hinton macosxhints.com . )

so as to use this tip in thebashshell , you ’ll need to create a function in a special Indian file in your substance abuser ’s Home directory — that ’s the directory where you ’ll find Documents , Movies , Pictures , etc . The particular Indian file is named.profile , and anything within it will be executed whenever you open up a young Terminal window . Since its name begins with a period , it will be invisible in the Finder , though you ’ll be able to see it usingls -ain Terminal . You should be able-bodied to create the file cabinet with passably much any text editor in chief , though you ’ll probably get a admonition when you seek to save it under the name.profile . If you do , just know the warning and save the data file anyway . ( observe that succeeding redaction of this data file may be a chip trickier , as your editor program may or may not be able-bodied to show inconspicuous files in the undecided dialogue . If that ’s the pillowcase , you ’ll have to use Terminal to open it — open -e .testfilewill open it in TextEdit , for deterrent example . )

Article image

For today ’s hint , I ’ll arrogate you ’re using whatever GUI text editor program you ’re most comfortable with , though this can evidently be done from Terminal usingviornano , etc . ; just make indisputable you create the single file at the top grade of your Users folder . In your editor in chief of choice , open up a raw blank document and introduce this codification :

remark that there ’s a chance you may already have a.profilefile — if that ’s the case , then add these lines as new ; do n’t replace any existing line .

The first line , pman , is the name of the command as you ’ll typewrite it to habituate this steer . find devoid to change it to whatever you wish — shorter is better , as it means less typing . To make certain you do n’t use a name of an already - existing instruction , open Terminal and try typing the name you ’d like to use , followed by — help . The response you want to see iscommand not find out . If you do n’t see that , try another name . Once you ’ve found a name you like , keep your emended file with the name .profile in the top level of your Users folder .

That ’s it ; you ’re done . Here ’s what the command you just created looks like in activeness :

So how does this cracking bidding employment ? Well , the remainder of the lines afterpmanare the social function that does the actual employment of exhibit themanpages in Preview . The open - curly - wall bracket strike off the head start of the computer code itself , which works like this :

The real pecker to thank here is 10.4 ’s Preview , which gained the power to record PostScript and convert it on the tent-fly into a standard PDF document . Once the text file is opened in Preview , you could do whatever you like with it — save it somewhere , print it , or just interpret it , find what you postulate , then close up it — the document is created in remembering only , so you do n’t need to worry about leave behind files that take later clean up .

put it to the test

To test your raw function , spread out a fresh Terminal windowpane , and then typepman bash(or any other command you ’re interested in seeing ) . Thebashmanual is jolly sizeable , so depending on the amphetamine of your simple machine , you may have to hold back 10 seconds or so as the control does its matter . But when it ’s done , you ’ll see Preview open , showing the full 60 - varlet manual .

Enjoy your newly - initialise and easy - to - readmanpages !