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/03/01 21:41]
billdozor [Other locations for documentation]
linux_wiki:locate_read_and_use_system_documentation_including_man_info_and_files_in_usr_share_doc [2019/05/25 23:50] (current)
Line 113: 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.1456886499.txt.gz
  • Last modified: 2019/05/25 23:50
  • (external edit)