Displaying package man pages
This topic explains how to display man pages provided by packages installed on your system.
The version of a service and productivity tools package can vary between Linux® distributions. You might also want to install the latest version of an open source package that is available online. Given this variance and flexibility, the best source of accurate and relevant information for commands in a package are the man pages installed with the commands.
To determine the man pages provided by a package installed on your system, list the file content of the package by running rpm -ql package-name. Man page path names typically contain /man/:
# rpm -ql servicelog
/usr/bin/log_repair_action
/usr/bin/servicelog
/usr/bin/servicelog_manage
/usr/bin/servicelog_notify
/usr/bin/v1_servicelog
/usr/bin/v29_servicelog
/usr/sbin/slog_common_event
/usr/share/doc/packages/servicelog
/usr/share/doc/packages/servicelog/COPYING
/usr/share/man/man8/log_repair_action.8.gz
/usr/share/man/man8/servicelog.8.gz
/usr/share/man/man8/servicelog_notify.8.gz
You can display the man pages you discover with the man command:
# man log_repair_action
LOG_REPAIR_ACTION(8) POWER Diagnostic Tools LOG_REPAIR_ACTION(8)
NAME
log_repair_action - create a log entry to indicate that a device was repaired
SYNOPSIS
/usr/sbin/log_repair_action -l location-code [-q]
/usr/sbin/log_repair_action -l location-code -d date [-q]
DESCRIPTION
The log_repair_action command creates an entry in the error log to indicate that
the device at the specified location code has been repaired. When viewing a list
of platform errors, all errors on the device at the specified location code prior
to the specified date will be considered closed (fixed).
OPTIONS
-l location-code or --location="location-code"
Specify the lcoation code of the device which was repaired.
-d date or --date="date"
Specify the date and time on which the device was repaired. If not speci-
fied, defaults to the current date/time.
-q or --quiet
Do not prompt for confirmation or print error messages.
AUTHOR
Written by Michael Strosaker (strosake@austin.ibm.com)
SEE ALSO
servicelog(8) sysdiag(8)
Linux February 2005 LOG_REPAIR_ACTION(8)
:
The following example script simplifies discovering and displaying the man pages provided by a package. It displays a selection list of the man pages provided by a required package-name argument. It then displays the man page for a selection.
#! /bin/bash
if [ -z "$1" ];then
echo "missing package-name argument"
exit 1
fi
# Discover the man pages in the package. "sort -u" to keep only unique
# instances in case there are duplicate pages in different languages.
man_pages=`rpm -ql $1 | sed -n 's/^.*\/\(.*\)\.\(\w\)\.gz$/\1\[\2\]/p' | sort -u`
# Show a selection list. Pass a selected man page to the man command.
PS3="Select man page: "
select man_page in $man_pages; do
man `echo "$man_page" | sed 's/^\(.*\)\[\(.*\)\]$/\2 \1/'`
done
The following example shows running the script to list man pages in the servicelog page, and then display the log_repair_action man page. It assumes that the script was copied and pasted into a file named pkg-man in the current directory, and that the execute permissions of the pkg-man file are set.
# ./pkg-man servicelog
1) log_repair_action[8]
2) servicelog[8]
3) servicelog_notify[8]
Select man page: 1 (<enter> is pressed here)
LOG_REPAIR_ACTION(8) POWER Diagnostic Tools LOG_REPAIR_ACTION(8)
NAME
log_repair_action - create a log entry to indicate that a device was repaired
SYNOPSIS
/usr/sbin/log_repair_action -l location-code [-q]
/usr/sbin/log_repair_action -l location-code -d date [-q]
DESCRIPTION
The log_repair_action command creates an entry in the error log to indicate that
the device at the specified location code has been repaired. When viewing a list
of platform errors, all errors on the device at the specified location code prior
to the specified date will be considered closed (fixed).
OPTIONS
-l location-code or --location="location-code"
Specify the lcoation code of the device which was repaired.
-d date or --date="date"
Specify the date and time on which the device was repaired. If not speci-
fied, defaults to the current date/time.
-q or --quiet
Do not prompt for confirmation or print error messages.
AUTHOR
Written by Michael Strosaker (strosake@austin.ibm.com)
SEE ALSO
servicelog(8) sysdiag(8)
Linux February 2005 LOG_REPAIR_ACTION(8)
: