Search This Blog

Wednesday, July 20, 2011

Linux File Operations

FIND AND REMOVE

find . -type f -name "FILE-TO-FIND" -exec rm -f {} \;
find . -type d -name "DIR-TO-FIND" -exec rm -rf {} \;


FIND BY SIZE
find {/path/to/directory} -type f -size +{file-size-in-kb}k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'