linux_wiki:locate_read_and_use_system_documentation_including_man_info_and_files_in_usr_share_doc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
linux_wiki:locate_read_and_use_system_documentation_including_man_info_and_files_in_usr_share_doc [2016/02/29 23:02]
billdozor [Locate Read And Use System Documentation Including Man Info And Files In Usr Share Doc]
linux_wiki:locate_read_and_use_system_documentation_including_man_info_and_files_in_usr_share_doc [2019/05/25 23:50] (current)
Line 14: Line 14:
 </code> </code>
   * This is required for search results to be returned correctly (if it has not been done)   * This is required for search results to be returned correctly (if it has not been done)
 +  * This command replaces the "makewhatis" command in RHEL 4/5/6.
  
 +\\
 Search man page title and description only Search man page title and description only
 <code bash> <code bash>
Line 20: Line 22:
 </code> </code>
  
 +\\
 Search man page documentation for keyword (title, description, and pages) Search man page documentation for keyword (title, description, and pages)
 <code bash> <code bash>
Line 25: Line 28:
 </code> </code>
  
 +\\
 Open specific man page section Open specific man page section
 <code bash> <code bash>
Line 65: Line 69:
 </code> </code>
  
 +\\
 Open the tee section of coreutils Open the tee section of coreutils
 <code bash> <code bash>
Line 84: Line 89:
   * updatedb => updates the search index, usually done via cron   * updatedb => updates the search index, usually done via cron
  
 +\\
 Show location of binary Show location of binary
 <code bash> <code bash>
Line 89: Line 95:
 </code> </code>
  
 +\\
 Search man page descriptions only Search man page descriptions only
 <code bash> <code bash>
Line 94: Line 101:
 </code> </code>
  
 +\\
 Find binary, source files, config files, and man page locations Find binary, source files, config files, and man page locations
 <code bash> <code bash>
Line 99: Line 107:
 </code> </code>
  
 +\\
 Search documenation installed Search documenation installed
 <code bash> <code bash>
Line 104: Line 113:
 </code> </code>
   * Only if installed via a rpm package (either via rpm or yum)   * Only if installed via a rpm package (either via rpm or yum)
 +
 +----
 +
 +===== Finding Files With Locate And Find =====
 +
 +==== Locate ====
 +
 +Search cache database for patterns, very fast, but simple pattern searching.
 +
 +Install package
 +<code bash>
 +yum install mlocate
 +</code>
 +
 +\\
 +Update cache database
 +<code bash>
 +updatedb
 +</code>
 +
 +\\
 +Find files/folders called "syslog"
 +<code bash>
 +locate syslog
 +</code>
 +
 +----
 +
 +==== Find ====
 +
 +Real time searching. Slower, but more flexible.
 +
 +Find files/directories with motd in the name
 +<code bash>
 +find / -name motd
 +</code>
 +
 +\\
 +Find, starting in /, all files (type f) owned by rjones
 +<code bash>
 +find / -user rjones -type f
 +</code>
 +
 +\\
 +Remove all files owned by rjones
 +<code bash>
 +find / -user rjones -type f -exec rm '{}' \;
 +</code>
 +
 +\\
 +Find all files modified in the last 3 days
 +<code bash>
 +find / -mtime -3 -type f
 +</code>
  
 ---- ----
  
  • linux_wiki/locate_read_and_use_system_documentation_including_man_info_and_files_in_usr_share_doc.1456804928.txt.gz
  • Last modified: 2019/05/25 23:50
  • (external edit)