From Electron Cloud
Jump to: navigation, search
Line 14: Line 14:
 
<pre>
 
<pre>
 
find . -mtime +1 -exec rm {} \;   
 
find . -mtime +1 -exec rm {} \;   
 +
</pre>
 +
 +
To find files, links, etc. but NOT directories, and omit the leading ".":
 +
<pre>
 +
find –not –type d | sed ‘s/.//’
 
</pre>
 
</pre>

Revision as of 14:28, 11 April 2008

To change every directory to have ug+rwx and sticky:

find . -type d -print0 | xargs -0 chmod 1770

-print0 and -0 are to deal with spaces in the filenames.


For read/write but NOT execute on normal files:

find . -type f -print0 | xargs -0 chmod 0660

To delete old files (e.g. older than one day):

find . -mtime +1 -exec rm {} \;  

To find files, links, etc. but NOT directories, and omit the leading ".":

find –not –type d | sed ‘s/.//’