GNU Find tricks

From D3xt3r01.tk
Revision as of 10:46, 6 January 2010 by Admin (talk | contribs) (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...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

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` \;