Sunday, 29 August 2010

Recursive find files and ...

Find all files of type CR2 and then delete them.

Note: The -print0 and -0 these options force the commands to use null terminators instead of spaces therefore you can remove files with spaces in the name.

find . -name *.CR2 -print0 | xargs -0 rm

Need to apply CHMOD command to only files that have a specific name recursively

Xargs to the rescue!

find -name fish.txt | xargs chmod 755

Clean all pyc files recursively:

find . -name "*.pyc" -exec rm -rf {} \;

No comments:

Post a Comment