Difference between revisions of "GNU Find Examples"
Jump to navigation
Jump to search
Michael.mast (talk | contribs) |
Michael.mast (talk | contribs) |
||
Line 1: | Line 1: | ||
+ | ==Find files based on "creation" time== | ||
+ | Normally I use ctime, but there was one directory that was constantly being changed. Ended up using mtime since the file contents never changed. | ||
+ | <pre> | ||
+ | find /somedir/ -type f -mtime -90 | ||
+ | </pre> | ||
==Relative paths== | ==Relative paths== | ||
<ref>https://unix.stackexchange.com/questions/104800/find-output-relative-to-directory</ref> | <ref>https://unix.stackexchange.com/questions/104800/find-output-relative-to-directory</ref> | ||
<pre> | <pre> | ||
− | find /somedir/ -type f | + | find /somedir/ -type f -exec realpath --relative-to /somedir {} \; |
</pre> | </pre> |
Latest revision as of 11:16, 18 December 2019
Find files based on "creation" time
Normally I use ctime, but there was one directory that was constantly being changed. Ended up using mtime since the file contents never changed.
find /somedir/ -type f -mtime -90
Relative paths
find /somedir/ -type f -exec realpath --relative-to /somedir {} \;