Find
From Useful Things
Revision as of 07:52, 19 April 2015 by Milosivanovic (talk | contribs)
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
Find files and do something with each
find . -type f -print0 | xargs -0 <command>-print0 print the full file name on the standard output, followed by a null character (instead of the newline character that -print uses)
-0 input items are terminated by a null character instead of by whitespace, and the quotes and backslash are not special (every character is taken literally).