Differences
This shows you the differences between two versions of the page.
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:40] billdozor [man pages] |
linux_wiki:locate_read_and_use_system_documentation_including_man_info_and_files_in_usr_share_doc [2019/05/25 23:50] (current) |
||
---|---|---|---|
Line 69: | Line 69: | ||
</ | </ | ||
+ | \\ | ||
Open the tee section of coreutils | Open the tee section of coreutils | ||
<code bash> | <code bash> | ||
Line 88: | 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 93: | Line 95: | ||
</ | </ | ||
+ | \\ | ||
Search man page descriptions only | Search man page descriptions only | ||
<code bash> | <code bash> | ||
Line 98: | Line 101: | ||
</ | </ | ||
+ | \\ | ||
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 103: | Line 107: | ||
</ | </ | ||
+ | \\ | ||
Search documenation installed | Search documenation installed | ||
<code bash> | <code bash> | ||
Line 108: | Line 113: | ||
</ | </ | ||
* 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 | ||
+ | </ | ||
+ | |||
+ | \\ | ||
+ | Update cache database | ||
+ | <code bash> | ||
+ | updatedb | ||
+ | </ | ||
+ | |||
+ | \\ | ||
+ | Find files/ | ||
+ | <code bash> | ||
+ | locate syslog | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Find ==== | ||
+ | |||
+ | Real time searching. Slower, but more flexible. | ||
+ | |||
+ | Find files/ | ||
+ | <code bash> | ||
+ | find / -name motd | ||
+ | </ | ||
+ | |||
+ | \\ | ||
+ | Find, starting in /, all files (type f) owned by rjones | ||
+ | <code bash> | ||
+ | find / -user rjones -type f | ||
+ | </ | ||
+ | |||
+ | \\ | ||
+ | Remove all files owned by rjones | ||
+ | <code bash> | ||
+ | find / -user rjones -type f -exec rm ' | ||
+ | </ | ||
+ | |||
+ | \\ | ||
+ | Find all files modified in the last 3 days | ||
+ | <code bash> | ||
+ | find / -mtime -3 -type f | ||
+ | </ | ||
---- | ---- | ||