7

I want to get output of any desired description or option from a man page.

Example: I want to get the description for the autoclean option from the apt-get man page:

Please suggest a command, something like man apt-get | <somecommands> autoclean to get this output:

autoclean
           Like clean, autoclean clears out the local repository of retrieved package files. The difference is that it only removes package files that can no longer be downloaded, and are
           largely useless. This allows a cache to be maintained over a long period without it growing out of control. The configuration option APT::Clean-Installed will prevent installed
           packages from being erased if it is set to off.

I've tried man apt-get | grep autoclean but it is limited to out-put matching lines for word autoclean so I can't get full description and seems it is not that what I want!

Hence, Help me to filter part from man-page for expected output mentioned above.

(Here apt-get and autoclean is only used as example I am asking this question because when man-page is too long then filtering by such way is very helpful for getting exact thing)

merged by terdon Jan 25 '15 at 10:27

This question was merged with Is there way to see `man` document only for specified option of a command because it is an exact duplicate of that question.