Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next 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 [2016/03/01 21:46] billdozor [Other locations for documentation] |
||
---|---|---|---|
Line 113: | 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 | ||
+ | </ | ||
---- | ---- | ||