RHEL7: Locate, read, and use system documentation including man, info, and files in /usr/share/doc.

Share this link

Note: This is an RHCSA 7 exam objective.

The man pages

To get some information about a command (here ps), type:

# man ps

Sometimes several man pages exist for a command (here ps), to list them, type:

# whatis ps
ps (1) - report a snapshot of the current processes
ps (1p) - report process status

If you are not sure about the command name and want to search for a string (here ps), type:

# apropos ps
capsh (1) - capability shell wrapper
...
getpt (3) - open the pseudo-terminal master (PTM)

Each time a new package is installed, the associated man pages are added but the index database is not directly updated. This task is executed by cron once a day (see the /etc/cron.daily/man-db.cron file).

If you want to update this index database used by the whatis and apropos commands without waiting for the cron update, type:

# mandb

Note: The makewhatis command available in RHEL 4/5/6 has been replaced with the mandb command.

The info command

Also, some commands (here ipc) offer additional documentation that you can get as follows:

# info ipc

To get the list of these commands, type:

# ls /usr/share/info
accounting.info.gz    gawk.info.gz        libc.info-10.gz  make.info-2.gz
as.info.gz            gccgo.info.gz       libc.info-11.gz  make.info.gz
bash.info.gz          gcc.info.gz         libc.info-12.gz  nano.info.gz
bc.info.gz            gccinstall.info.gz  libc.info-13.gz  nettle.info.gz
binutils.info.gz      gccint.info.gz      libc.info-14.gz  parted.info.gz
chrony.info.gz        gettext.info.gz     libc.info-1.gz   pinentry.info.gz
configure.info.gz     gnupg.info-1.gz     libc.info-2.gz   pinfo.info.gz
coreutils.info.gz     gnupg.info-2.gz     libc.info-3.gz   rluserman.info.gz
cpio.info.gz          gnupg.info.gz       libc.info-4.gz   sed.info.gz
cpp.info.gz           gprof.info.gz       libc.info-5.gz   standards.info.gz
cppinternals.info.gz  grep.info.gz        libc.info-6.gz   tar.info-1.gz
dc.info.gz            grub2-dev.info.gz   libc.info-7.gz   tar.info-2.gz
diffutils.info.gz     grub2.info.gz       libc.info-8.gz   tar.info.gz
dir                   gzip.info.gz        libc.info-9.gz   time.info.gz
ed.info.gz            history.info.gz     libc.info.gz     wget.info.gz
find.info.gz          info.info.gz        libgomp.info.gz  which.info.gz
find-maint.info.gz    info-stnd.info.gz   libidn.info.gz
gawkinet.info.gz      ld.info.gz          make.info-1.gz

The locate command

In addition, the locate command provides results similar to the find / -name command and uses a dedicated index database called mlocate.db. This database is updated by cron once a day (see the /etc/cron.daily/mlocate file).

To search for a specific file (here sysctl.conf), type:

# locate sysctl.conf
/etc/sysctl.conf
/etc/sysctl.d/99-sysctl.conf
/usr/share/man/man5/sysctl.conf.5.gz

To update the mlocate.db index database without waiting for the cron update, type:

# updatedb

The packages documentation

Also, don’t forget how to find the package name providing a specific command (here mandb):

# yum whatprovides */mandb
...
man-db-2.6.3-9.el7.x86_64 : Tools for searching and reading man pages
Repo        : @anaconda
Matched from:
Filename    : /usr/bin/mandb

Note: The search is not only local but also in all the remote, currently configured repositories.

And, to search for a string (here sysctl.conf) in a package (here initscripts), type:

# rpm -ql initscripts | grep sysctl.conf
/etc/sysctl.conf
/etc/sysctl.d/99-sysctl.conf

Note1: The use of the locate command should be quicker.
Note2: Use the -qpl option with the complete path, if the package hasn’t still been installed.

Finally, most packages come with their own documentation in the /usr/share/doc directory.

Note: Most of the SELinux documentation is not installed by default any more, you need to install it yourself. Hopefully, you can follow the tutorial about deploying SELinux man pages.

You can also get the various man pages and documentation available for a given package (here less):

# rpm -qd less
/usr/share/doc/less-458/LICENSE
/usr/share/man/man1/less.1.gz
/usr/share/man/man1/lessecho.1.gz
/usr/share/man/man1/lesskey.1.gz

Additional useful commands

Also, various commands can provide some help.

The which command gives you the system path associated with a command by relying on your PATH environment variable.

# which mandb
/usr/bin/mandb

The whereis command displays the system path of a command, the associated man page file and other files with this name known by the system. It relies on your PATH and MANPATH environment variables but not only.

# whereis httpd
httpd: /usr/sbin/httpd /usr/lib64/httpd /etc/httpd /usr/share/httpd /usr/share/man/man8/httpd.8.gz
(8 votes, average: 4.13 out of 5)
Loading...
5 comments on “RHEL7: Locate, read, and use system documentation including man, info, and files in /usr/share/doc.
  1. xpert123 says:

    Do we have a solutions for Task of the day exercises?

  2. twostep says:

    If you want to find the doc files for a given command (semanage for example):
    rpm -qd $(rpm -qf $(which semanage))

  3. hallo says:

    Surprised by the contents of info rluserman – cut & paste, undo, etc ?!?!?!

Leave a Reply

Upcoming Events (Local Time)

There are no events.

Follow me on Twitter

Archives

vceplus-200-125    | boson-200-125    | training-cissp    | actualtests-cissp    | techexams-cissp    | gratisexams-300-075    | pearsonitcertification-210-260    | examsboost-210-260    | examsforall-210-260    | dumps4free-210-260    | reddit-210-260    | cisexams-352-001    | itexamfox-352-001    | passguaranteed-352-001    | passeasily-352-001    | freeccnastudyguide-200-120    | gocertify-200-120    | passcerty-200-120    | certifyguide-70-980    | dumpscollection-70-980    | examcollection-70-534    | cbtnuggets-210-065    | examfiles-400-051    | passitdump-400-051    | pearsonitcertification-70-462    | anderseide-70-347    | thomas-70-533    | research-1V0-605    | topix-102-400    | certdepot-EX200    | pearsonit-640-916    | itproguru-70-533    | reddit-100-105    | channel9-70-346    | anderseide-70-346    | theiia-IIA-CIA-PART3    | certificationHP-hp0-s41    | pearsonitcertification-640-916    | anderMicrosoft-70-534    | cathMicrosoft-70-462    | examcollection-cca-500    | techexams-gcih    | mslearn-70-346    | measureup-70-486    | pass4sure-hp0-s41    | iiba-640-916    | itsecurity-sscp    | cbtnuggets-300-320    | blogged-70-486    | pass4sure-IIA-CIA-PART1    | cbtnuggets-100-101    | developerhandbook-70-486    | lpicisco-101    | mylearn-1V0-605    | tomsitpro-cism    | gnosis-101    | channel9Mic-70-534    | ipass-IIA-CIA-PART1    | forcerts-70-417    | tests-sy0-401    | ipasstheciaexam-IIA-CIA-PART3    | mostcisco-300-135    | buildazure-70-533    | cloudera-cca-500    | pdf4cert-2v0-621    | f5cisco-101    | gocertify-1z0-062    | quora-640-916    | micrcosoft-70-480    | brain2pass-70-417    | examcompass-sy0-401    | global-EX200    | iassc-ICGB    | vceplus-300-115    | quizlet-810-403    | cbtnuggets-70-697    | educationOracle-1Z0-434    | channel9-70-534    | officialcerts-400-051    | examsboost-IIA-CIA-PART1    | networktut-300-135    | teststarter-300-206    | pluralsight-70-486    | coding-70-486    | freeccna-100-101    | digitaltut-300-101    | iiba-CBAP    | virtuallymikebrown-640-916    | isaca-cism    | whizlabs-pmp    | techexams-70-980    | ciscopress-300-115    | techtarget-cism    | pearsonitcertification-300-070    | testking-2v0-621    | isacaNew-cism    | simplilearn-pmi-rmp    | simplilearn-pmp    | educationOracle-1z0-809    | education-1z0-809    | teachertube-1Z0-434    | villanovau-CBAP    | quora-300-206    | certifyguide-300-208    | cbtnuggets-100-105    | flydumps-70-417    | gratisexams-1V0-605    | ituonline-1z0-062    | techexams-cas-002    | simplilearn-70-534    | pluralsight-70-697    | theiia-IIA-CIA-PART1    | itexamtips-400-051    | pearsonitcertification-EX200    | pluralsight-70-480    | learn-hp0-s42    | giac-gpen    | mindhub-102-400    | coursesmsu-CBAP    | examsforall-2v0-621    | developerhandbook-70-487    | root-EX200    | coderanch-1z0-809    | getfreedumps-1z0-062    | comptia-cas-002    | quora-1z0-809    | boson-300-135    | killtest-2v0-621    | learncia-IIA-CIA-PART3    | computer-gcih    | universitycloudera-cca-500    | itexamrun-70-410    | certificationHPv2-hp0-s41    | certskills-100-105    | skipitnow-70-417    | gocertify-sy0-401    | prep4sure-70-417    | simplilearn-cisa    |
http://www.pmsas.pr.gov.br/wp-content/    | http://www.pmsas.pr.gov.br/wp-content/    |