GNU Find tricks: Difference between revisions

From D3xt3r01.tk
Jump to navigationJump to search
m (New page: ==WHY== Because I find myself searching files I want to do stuff to ... ==HOW== Find and delete directories <source lang="bash"> find . -type d -exec rm -rf {} \; </source> Find and c...)
 
(No difference)

Latest revision as of 11:46, 6 January 2010

WHY

Because I find myself searching files I want to do stuff to ...

HOW

Find and delete directories

find . -type d -exec rm -rf {} \;

Find and count files

find . -type f | wc -l

Find all files and move them in the current dir

find . -type f -exec mv {} `pwd` \;