2013-12-11 21:23:59 +11:00
|
|
|
# find
|
|
|
|
|
2013-12-25 22:53:43 +11:00
|
|
|
> Find files under the given directory tree, recursively
|
2013-12-11 21:23:59 +11:00
|
|
|
|
|
|
|
- find files by extension
|
|
|
|
|
|
|
|
`find {{root_path}} -name {{'*.py'}}`
|
|
|
|
|
|
|
|
- run a command for each file
|
2013-12-25 22:53:43 +11:00
|
|
|
- use {} within the command to access the filename
|
2013-12-11 21:23:59 +11:00
|
|
|
|
2013-12-25 22:53:43 +11:00
|
|
|
`find {{root_path}} -name {{'*.py'}} -exec {{command}} \;`
|
2013-12-11 21:23:59 +11:00
|
|
|
|
|
|
|
- find files modified since a certain time
|
|
|
|
|
|
|
|
`find {{root_path}} -name {{'*.py'}} -mtime {{-1d}}`
|
2014-01-26 11:54:37 -05:00
|
|
|
|
|
|
|
- remove files recursively
|
|
|
|
|
|
|
|
`find {{root_path}} -name {{'*.py'}} -exec rm {} \;`
|