Difference between revisions of "Find"

From Useful Things
Jump to: navigation, search
(Created page with "== Between dates == <syntaxhighlight lang="bash"> find / -newermt "27 Dec 2013" ! -newermt "1 Jan 2014" </syntaxhighlight>")
 
Line 4: Line 4:
 
find / -newermt "27 Dec 2013" ! -newermt "1 Jan 2014"
 
find / -newermt "27 Dec 2013" ! -newermt "1 Jan 2014"
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
<code>-newermt</code> newer than specified modification time<br />
 +
<code>!</code> invert proceeding condition
 +
 +
== Several matches ==
 +
<syntaxhighlight lang="bash">
 +
find / -xdev \( -name .DS_Store -o -name ._DS_Store \)
 +
</syntaxhighlight>
 +
<code>-xdev</code> stay on the current filesystem<br />
 +
<code>-o</code> logical OR, use parentheses for clarity - must be escaped in bash

Revision as of 11:24, 30 June 2014

Between dates

find / -newermt "27 Dec 2013" ! -newermt "1 Jan 2014"

-newermt newer than specified modification time
! invert proceeding condition

Several matches

find / -xdev \( -name .DS_Store -o -name ._DS_Store \)

-xdev stay on the current filesystem
-o logical OR, use parentheses for clarity - must be escaped in bash