⇤ ← Revision 1 as of 2011-03-31 23:00:57
Size: 300
Comment: Delete files not modified in n days
|
Size: 457
Comment: Replace text in all files in & under the current directory
|
Deletions are marked like this. | Additions are marked like this. |
Line 12: | Line 12: |
=== Replace text in all files in & under the current directory === {{{#!highlight sh numbers=off find . -type f -exec sed -i 's/old/new/g' {} \; }}} |
Contents
Delete files not modified in n days
Useful for clearing out caches that aren't properly cleaned out otherwise.
# Delete files not modified in 30 days
find /path/to/files* -mtime +30 -exec rm {} \;
Replace text in all files in & under the current directory
find . -type f -exec sed -i 's/old/new/g' {} \;